pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jim C. Nasby <jim@nasby.net>
To: pgsql-performance@postgresql.org
Subject: Re: Partial index where clause not filtering through
Date: Mon, 16 Jun 2003 17:32:09 -0500
Message-ID: <20030616223209.GK40542@flake.decibel.org> (raw)
In-Reply-To: <2619.1055772660@sss.pgh.pa.us>
References: <20030616003118.S66185@flake.decibel.org>
	<26793.1055742214@sss.pgh.pa.us>
	<20030616012456.U66185@flake.decibel.org>
	<2619.1055772660@sss.pgh.pa.us>

On Mon, Jun 16, 2003 at 10:11:00AM -0400, Tom Lane wrote:
> "Jim C. Nasby" <jim@nasby.net> writes:
> > Well, it would only need to make the checks if the table had partial
> > indexes. Even then, it probably makes sense to only do the check if
> > other query planning steps decide it would be useful to use the partial
> > index.
> 
> You have that backwards.  Planning is bottom-up, so we have to determine
> the relevant indexes *first*.  Accordingly, a partial index is a
> performance drag on every query that uses its table, as we check to
> see if the partial index qual is satisfied by the query's WHERE clause.
> That's why I don't want it to be any slower than it is ...
 
Well, could it assume the index was valid until we got to the point
where we had to decide what index to use? In other words, don't do the
test unless the index appears to be the most attractive one. Also, as I
mentioned, if query parsing performance is that important, you can
explicitly add whatever clause will show the planner that the index is
valid.

Also, I just read that there's no statement plan caching, which makes me
a bit confused by this todo:

Flush cached query plans when their underlying catalog data changes

Does that only apply to pl/pgsql? Are there plans to add a statement
cache?
-- 
Jim C. Nasby (aka Decibel!)                    jim@nasby.net
Member: Triangle Fraternity, Sports Car Club of America
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"



view thread (6+ messages)  latest in thread

Message-ID: <20030616223209.GK40542@flake.decibel.org>
Permalink:  ../20030616223209.GK40542@flake.decibel.org/
Also on:    postgresql.org/message-id/20030616223209.GK40542@flake.decibel.org

 · 

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: jim@nasby.net
  Subject: Re: Partial index where clause not filtering through
  In-Reply-To: <20030616223209.GK40542@flake.decibel.org>
  References: <20030616003118.S66185@flake.decibel.org> <26793.1055742214@sss.pgh.pa.us> <20030616012456.U66185@flake.decibel.org> <2619.1055772660@sss.pgh.pa.us> <20030616223209.GK40542@flake.decibel.org>

* 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