I have the following index:
CREATE INDEX in_table_1
ON table_1
USING btree
((COALESCE(col_1, 30001231::bigint)), col_2);
and the following select
select * from tabela_1
where coalesce(col_1, 30001231) >= 20150630 and col_1 <= 20150630
Im having a performance problem, I checked and my select is not using the index I created.
If I drop and recreate the index, my select uses it.
I noticed that after running a vacuum on the table, the problem starts again.
The vacuum is doing something that makes the database stop using the index?