Greetings,
The following is using version 11.2 of PostgreSQL.
I've got a table with about 30 million rows and a particular index that up until recently was actively being used.
And then it stopped being used and the query that the index was made for, is now doing sequential scans.
Deleting the index and creating it again, seems to fix the problem. The new index, which is identical in composition, is being used and the query in question no longer uses sequential scans.
It's the exact same query and the index is identical in composition. Yet after a while the database stops using it. I'd like to find out why that is and how to prevent it.
Also, I'm assuming this is the correct list for such a question?
In the past, I had asked this somewhere else, but then no longer had time to spend on it: https://dba.stackexchange.com/questions/264237/
Some data I gathered then:
- Size of the index not being used is 101MB.
- Size of the index being used is 16MB.
Here is the "explain analyze" for index used: https://explain.depesz.com/s/H5X9y
Here is the "explain analyze" for index not used: https://explain.depesz.com/s/n6bP