Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)

From: "Sergey Konoplev" <gray(dot)ru(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Richard Huxton" <dev(at)archonet(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org >> PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Date: 2008-11-12 15:23:16
Message-ID: c3a7de1f0811120723x3169f747p5de78739b06a4eb3@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

>> 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-11-12 15:40:01 Re: Table bloat and vacuum
Previous Message Alvaro Herrera 2008-11-12 15:19:23 Re: Table bloat and vacuum

Browse pgsql-hackers by date

  From Date Subject
Next Message Sam Mason 2008-11-12 15:45:52 Re: So what's an "empty" array anyway?
Previous Message Robert Haas 2008-11-12 14:46:09 Re: So what's an "empty" array anyway?