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 c3a7de1f0811110402m1d567b21ne9e699158cd366db@mail.gmail.com
Whole thread Raw
In response to Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Richard Huxton <dev@archonet.com>)
Responses Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Richard Huxton <dev@archonet.com>)
List pgsql-general
>
> Can you post the EXPLAIN ANALYSE output from your NOT IN query?
>

 Seq Scan on table1  (cost=0.00..12648.25 rows=3351 width=0) (actual
time=0.054..140.596 rows=5000 loops=1)
   Filter: (table1_id <> ALL ('{123456789000, ... plus 1999 ids'::bigint[]))
 Total runtime: 142.303 ms
(3 rows)

But actual (real) time of running "EXPLAIN SELECT 1 FROM table1 WHERE
table1_id NOT IN > (...~2000 ids here...);" is

2000 ids: 34102 ms

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

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Current log files when rotating?
Next
From: Richard Huxton
Date:
Subject: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)