Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-performance by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group