Re: Partial index where clause not filtering through

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jim(at)nasby(dot)net
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Partial index where clause not filtering through
Date: 2003-06-16 05:43:34
Message-ID: 26793.1055742214@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Jim C. Nasby" <jim(at)nasby(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Shridhar Daithankar 2003-06-16 06:15:52 Re: any way to use indexscan to get last X values
Previous Message Jim C. Nasby 2003-06-16 05:36:29 Re: left join performance problem