On Oct 1, 2014, at 12:34 AM, Misa Simic wrote:
Have you considered maybe partial indexes?
I.e idx1 on pk column of the table with where inside index exactly the same as your first where
Idx2 on pk column with where inside index as second where
That was actually my first attempt , and I was hoping it would work.
Unfortunately, there is always something in the queries that keeps Postgres trying to use other (slower) indexes or jumping to a sequential scan.
I haven't been able to trick the planner into using the partial index, and most online resources suggested it wasn't possible.