Greetings, * Thomas Kellerer (spam_eater@xxxxxxx) 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
Attachment:
signature.asc
Description: PGP signature