Re: surprising query optimisation

Поиск
Список
Период
Сортировка
От Chris Withers
Тема Re: surprising query optimisation
Дата
Msg-id 076fec6e-3bb4-3a99-e71f-dc1cec684cb6@withers.org
обсуждение исходный текст
Ответ на Re: surprising query optimisation  (Stephen Frost <sfrost@snowman.net>)
Ответы Re: surprising query optimisation  (Stephen Frost <sfrost@snowman.net>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: surprising query optimisation
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: surprising query optimisation