Re: Slow Queries with OR's? - Mailing list pgsql-general

From Tom Lane
Subject Re: Slow Queries with OR's?
Date
Msg-id 26377.1051626135@sss.pgh.pa.us
Whole thread Raw
In response to Slow Queries with OR's?  ("Mad Hatter" <mad_hatter_@hotmail.com>)
List pgsql-general
"Mad Hatter" <mad_hatter_@hotmail.com> writes:
> When I run the following query:
> SELECT attrib1 FROM table1 WHERE attrib2 IN ( '1', '3', '5', '7' );

Could we see the EXPLAIN ANALYZE output for that, as well as one of
these?

> SELECT attrib1 FROM table1 WHERE attrib2 = '1'

ISTM you should be getting roughly equivalent plans, that is an
indexscan for each of the constants.

(The nearby comments about IN being slow apply to "foo IN (SELECT ...)"
which this is not.)

            regards, tom lane


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Backend memory leakage when inserting
Next
From: Dennis Gearon
Date:
Subject: Re: Bug(?) with cursors using aggregate functions.