Re: surprising query optimisation

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: surprising query optimisation
Дата
Msg-id 20181205143340.GB3415@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: surprising query optimisation  (Thomas Kellerer <spam_eater@gmx.net>)
Список pgsql-general
Greetings,

* Thomas Kellerer (spam_eater@gmx.net) wrote:
> Stephen Frost schrieb am 30.11.2018 um 14:05:
> > PG doesn’t know, with complete certainty, that there’s only 3
> > values.
>
> Would the optimizer consult a check constraint ensuring that?

Not today, I don't believe (haven't looked at the code though, to be
fair), and seems like it'd be an awful lot of work for a rare
use-case that would be better with just a partial index..

What we will do today is if you ask for a specific value and there's a
CHECK constraint which lists out specific values and that value isn't
among the set, then we'll just skip over the table (One-time filter:
false), thanks to constraint exclusion.

Thanks!

Stephen

Вложения

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

Предыдущее
От: Dejan Petrovic
Дата:
Сообщение: Database corruption in cascaded replica, "pg_xact/003A" doesn'texist, reading as zeroes"
Следующее
От: Chris Withers
Дата:
Сообщение: debugging intermittent slow updates under higher load