Re: performance on selecting a row in large tables

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Rainer Spittel" <rainer(dot)spittel(at)terralink(dot)co(dot)nz>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: performance on selecting a row in large tables
Date: 2008-02-04 21:43:20
Message-ID: 8937.1202161400@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

"Rainer Spittel" <rainer(dot)spittel(at)terralink(dot)co(dot)nz> writes:
> One of those slow queries are running on col02 which has a btree
> index. But I use the 'in' expression to get a set of matching rows:
> select * from table where col02 in ('...',[...],'...')
> This query gets sometimes really slow, I guess it depends on the size
> of the set used by 'in'.

Don't guess. Use EXPLAIN ANALYZE and find out what is happening.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tino Schwarze 2008-02-04 21:46:53 Re: performance on selecting a row in large tables
Previous Message Rainer Spittel 2008-02-04 21:24:11 Re: performance on selecting a row in large tables