Sergey Konoplev wrote: > > I've faced strange parser (or may be planner) behaviour. When I do > "EXPLAIN SELECT 1 FROM table1 WHERE table1_id IN (...~2000 ids > here...);" it works as fast as I expect (50 ms). But when I rewrite it > using NOT IN "EXPLAIN SELECT 1 FROM table1 WHERE table1_id NOT IN > (...~2000 ids here...);" it gets much more slower (34537 ms). Can you post the EXPLAIN ANALYSE output from your NOT IN query? -- Richard Huxton Archonet Ltd -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general