Re: [repost] partial index / funxtional idx or bad sql?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: csajl <csajl(at)yahoo(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: [repost] partial index / funxtional idx or bad sql?
Date: 2003-05-13 03:32:10
Message-ID: 200305122032.10928.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Csajl,

> i'm using 7.3.2. i tried using EXISTS instead of the IN, but the same
> query now returns in seven sceonds as opposed to four with the IN.
<snip>
> classifieds_dual_idx is the btree index on (class_type_id, areacode)
> and site_cm_areacode_idx is the btree index on (site_id) only.
> there is an index in the areacode table that has both (site_id, areacode)
> but it's apparently not being used. would it help the query to use that
> index instead?

No.
>From the look of things, it's not the index scan that's taking time ... it's
the subplan, which is doing 61,000 loops. Which is normal for IN, but not
for EXISTS. You run VACUUM ANALYZE?

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Stephan Szabo 2003-05-13 03:47:55 Re: [repost] partial index / funxtional idx or bad sql?
Previous Message Nikolaus Dilger 2003-05-13 02:14:31 Re: PERFORMANCE and SIZE