Re: An "obvious" index not being used - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: An "obvious" index not being used
Date
Msg-id 485A1CA6.EE98.0025.0@wicourts.gov
Whole thread Raw
In response to An "obvious" index not being used  (Daniele Varrazzo <piro@develer.com>)
Responses Re: An "obvious" index not being used
List pgsql-performance
>>> Daniele Varrazzo <piro@develer.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

pgsql-performance by date:

Previous
From: Howard Cole
Date:
Subject: Re: Tsearch2 Initial Search Speed
Next
From: "Daniele Varrazzo"
Date:
Subject: Re: An "obvious" index not being used