"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