From: Tom Lane <tgl@sss.pgh.pa.us>
To: Rainer Spittel <rainer.spittel@terralink.co.nz>
Cc: pgsql-admin@postgresql.org
Subject: Re: performance on selecting a row in large tables
Date: Mon, 04 Feb 2008 16:43:20 -0500
Message-ID: <8937.1202161400@sss.pgh.pa.us> (raw)
In-Reply-To: <12B8F225666F99489CEFA8B3F261540CFAAE11@geneva.local.terralink>
References: <12B8F225666F99489CEFA8B3F261540CFAAE11@geneva.local.terralink>
"Rainer Spittel" <rainer.spittel@terralink.co.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, rainer.spittel@terralink.co.nz
Subject: Re: performance on selecting a row in large tables
In-Reply-To: <8937.1202161400@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox