Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case) - Mailing list pgsql-general

From Sergey Konoplev
Subject Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Date
Msg-id c3a7de1f0811120723x3169f747p5de78739b06a4eb3@mail.gmail.com
Whole thread Raw
In response to Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  ("Sergey Konoplev" <gray.ru@gmail.com>)
Responses Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Richard Huxton <dev@archonet.com>)
List pgsql-general
>> What configure options did you use, what locale/encoding are you using,
>> what nondefault settings have you got in postgresql.conf?
>>
>>                        regards, tom lane
>
> You are right. I've found the odd thing (that completely drives me
> mad) in postgresql.conf.
>
> You are able to reproduce slow-not-in queries by switching
> constraint_exclusion to on in your postgresql.conf and running my test
> (which is attached to the first message).
>

On more thing:

If you do

EXPLAIN SELECT 1 FROM table1 WHERE table1_id NOT IN (SELECT column1
FROM (VALUES (123),(456),(789),... a lot of IDs here...)_);

it works as fast as with constraint_exclusion turned to off.

--
Regards,
Sergey Konoplev
--
PostgreSQL articles in english & russian
http://gray-hemp.blogspot.com/search/label/postgresql/

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Table bloat and vacuum
Next
From: "Markus Wollny"
Date:
Subject: Suboptimal execution plan for simple query