pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: jim@nasby.net
Cc: pgsql-performance@postgresql.org
Subject: Re: Partial index where clause not filtering through
Date: Mon, 16 Jun 2003 01:43:34 -0400
Message-ID: <26793.1055742214@sss.pgh.pa.us> (raw)
In-Reply-To: <20030616003118.S66185@flake.decibel.org>
References: <20030616003118.S66185@flake.decibel.org>

"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



view thread (6+ messages)  latest in thread

Message-ID: <26793.1055742214@sss.pgh.pa.us>
Permalink:  ../26793.1055742214@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26793.1055742214@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jim@nasby.net
  Subject: Re: Partial index where clause not filtering through
  In-Reply-To: <26793.1055742214@sss.pgh.pa.us>
  References: <20030616003118.S66185@flake.decibel.org> <26793.1055742214@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox