Re: Partial index where clause not filtering through - Mailing list pgsql-performance

From Tom Lane
Subject Re: Partial index where clause not filtering through
Date
Msg-id 26793.1055742214@sss.pgh.pa.us
Whole thread Raw
In response to Partial index where clause not filtering through  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: Partial index where clause not filtering through
List pgsql-performance
"Jim C. Nasby" <jim@nasby.net> writes:
> As-is, it won't use the index. i.address_v IS NOT NULL AND s.addr_high_v
> >= i.address_v should mandate that s.addr_high_v must be not-null,

Actually, if the >= operator is strict then it implies both NOT NULL
conditions.  But I am not excited about putting some kind of theorem
prover into the partial-index logic.  That is a recipe for chewing up
huge numbers of cycles trying (and, likely, failing) to prove that
a partial index is safe to use with the current query.

Inference rules that are limited to strict operators and NOT NULL
clauses wouldn't cost as much as a general theorem prover, but they'd
not find useful improvements as often, either.  So the question is
still whether the game is worth the candle.  How often do you think
this would win, and is that worth the planner cycles expended on every
query to find out if it wins?

            regards, tom lane

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: left join performance problem
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: any way to use indexscan to get last X values