"Paul Janssen" <postgresuser(at)hotmail(dot)com> writes:
> Can anyone help me out with the following situation:
> (a) a single query with 550 id's in the IN-clause resulting into 800+
> seconds;
> (b) 550 queries with a single id in the IN-clause resulting into overall
> time of <60 seconds;
> The table consists of 950.000 records, and the resultset consists of 205.000
> records.
> Why is there such an extreme difference in time?
Most likely the planner is opting not to use an indexscan in the first
case. Could we see EXPLAIN ANALYZE results for both cases? Also, try
"SET enable_seqscan TO OFF" and then repeat EXPLAIN ANALYZE for case (a).
regards, tom lane