>>> On Tue, Feb 28, 2006 at 11:05 am, in message
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> The issue at hand really has nothing to do with temp indexes, it's
> the constrained way that the planner deals with EXISTS subplans.
Yet when the index exists, the query is optimized well.
> subplans themselves are cheap enough, even in the poorly- indexed
> variant, that the planner would certainly never have decided to
> an index to use for them.
That depends. If the planner was able to generate hypothetical index
descriptions which might be useful, and analyze everything based on
those (adding in creation cost, of course) -- why would it not be able
to come up with the plan which it DID use when the index existed.
> The limiting factor is that EXISTS subplans
> aren't flattened ... and once that's fixed, I doubt the example
> need any new kind of join support.
I'm all for that. So far, we've been going after the low-hanging fruit
in our use of PostgreSQL. When we get to the main applications, we're
going to be dealing with a lot more in the way of EXISTS clauses. The
product we're moving from usually optimized an IN test the same as the
logically equivalent EXISTS test, and where a difference existed, it
almost always did better with the EXISTS -- so we encouraged application
programmers to use that form. Also, EXISTS works in situations where
you need to compare on multiple columns, so it is useful in many
situations where EXISTS or MIN/MAX techniques just don't work.
If fixing this would allow hash or merge techniques to cover this as
well as the index did, and that is true in a more general sense (not
just for this one example), then temporary indexes would clearly not
have any value.
In response to
pgsql-performance by date
|Next:||From: Kevin Grittner||Date: 2006-02-28 17:55:32|
|Subject: Re: [PERFORM] temporary indexes|
|Previous:||From: Javier Somoza||Date: 2006-02-28 17:27:34|
|Subject: Re: fsync and battery-backed caches|
pgsql-hackers by date
|Next:||From: Heikki Linnakangas||Date: 2006-02-28 17:39:04|
|Subject: Re: Dead Space Map|
|Previous:||From: Mark Woodward||Date: 2006-02-28 17:36:03|
|Subject: Re: pg_config, pg_service.conf, postgresql.conf ....|