Re: [PERFORM] temporary indexes - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: [PERFORM] temporary indexes
Date
Msg-id 44046913.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to Re: [PERFORM] temporary indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PERFORM] temporary indexes
List pgsql-hackers
>>> On Tue, Feb 28, 2006 at 11:05 am, in message
<16076.1141146348@sss.pgh.pa.us>,
Tom Lane <tgl@sss.pgh.pa.us> wrote:
> The limiting factor is that EXISTS subplans
> aren't flattened ... and once that's fixed, I doubt the example
would
> need any new kind of join support.

I rewrote the query to use IN predicates rather than EXISTS predicates,
and the cost estimates look like this:

EXISTS, no index:  1.6 billion
EXISTS, with index:  0.023 billion
IN, no index:  13.7 billion
IN, with index:  10.6 billion

At least for the two EXISTS cases, the estimates were roughly accurate.
 These plans were run against the data after the fix, but analyze has
not been run since then, so the estimates should be comparable with the
earlier post.

I'm not used to using the IN construct this way, so maybe someone can
spot something horribly stupid in how I tried to use it.

-Kevin


Attachment

pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: [PERFORM] temporary indexes
Next
From: Tom Lane
Date:
Subject: bug in PG_VERSION_NUM patch