Re: An "obvious" index not being used

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Daniele Varrazzo" <piro(at)develer(dot)com>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: An "obvious" index not being used
Date: 2008-06-19 13:46:26
Message-ID: 485A1CA6.EE98.0025.0@wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

>>> Daniele Varrazzo <piro(at)develer(dot)com> wrote:

> select count(*) from foo
> where foo.account_id in (
> select id from accounts where system = 'abc');

> Total runtime: 13412.226 ms

Out of curiosity, how does it do with the logically equivalent?:

select count(*) from foo
where exists (select * from accounts
where accounts.id = foo.account_id
and accounts.system = 'abc');

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Daniele Varrazzo 2008-06-19 14:03:38 Re: An "obvious" index not being used
Previous Message Howard Cole 2008-06-19 09:03:37 Re: Tsearch2 Initial Search Speed