Re: [PERFORM] temporary indexes

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>,<pgsql-performance(at)postgresql(dot)org>
Subject: Re: [PERFORM] temporary indexes
Date: 2006-02-28 21:15:31
Message-ID: 44046913.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

>>> On Tue, Feb 28, 2006 at 11:05 am, in message
<16076(dot)1141146348(at)sss(dot)pgh(dot)pa(dot)us>,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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 Content-Type Size
datafix-in-plan1.txt application/octet-stream 4.2 KB
datafix-in-plan2.txt application/octet-stream 5.3 KB
datafix-in.qry application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-02-28 21:36:44 bug in PG_VERSION_NUM patch
Previous Message Jim C. Nasby 2006-02-28 21:02:32 Re: [PERFORM] temporary indexes

Browse pgsql-performance by date

  From Date Subject
Next Message Lukas Smith 2006-02-28 23:02:55 Re: [PERFORM] temporary indexes
Previous Message Jim C. Nasby 2006-02-28 21:09:25 Re: fsync and battery-backed caches