Re: surprising query optimisation

From: Chris Withers <chris(at)withers(dot)org>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: surprising query optimisation
Date: 2018-11-30 13:00:26
Message-ID: 076fec6e-3bb4-3a99-e71f-dc1cec684cb6@withers.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2018-11-30 13:05:49 Re: surprising query optimisation
Previous Message Stephen Frost 2018-11-30 12:55:13 Re: surprising query optimisation