On 30/11/2018 12:55, Stephen Frost wrote:
> > I'd suggest you check out the wiki article written about this kind of
> > question:
> >
> > https://wiki.postgresql.org/wiki/Slow_Query_Questions
>
>
> Have you tried a partial index on state!=‘RSV’?
The solution I originally posted, that we do easily enough at our query
generation layer, is working perfectly, but this is good to know for
next time.
My post here is mainly to try and understand what's going on so I can
improve my general feel for how to use postgres at it's best.
So, why was the query ending up being a big scan rather than some quick
lookups based on the index?
cheers,
Chris