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

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Дата
Msg-id 49197E5F.9020508@archonet.com
обсуждение исходный текст
Ответ на Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  ("Sergey Konoplev" <gray.ru@gmail.com>)
Ответы Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  ("Sergey Konoplev" <gray.ru@gmail.com>)
Список pgsql-general
Sergey Konoplev wrote:
>> 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

I've never heard of EXPLAIN ANALYSE being *faster* than the actual
query, it's usually slower due to all the timing calls. The only thing
it doesn't do is actually send the results over the connection to the
client. In your case, you're not actually selecting any columns, so that
can't be it.

Are you sure there's nothing subtly different about the slow query when
compared with the explain analyse?

--
  Richard Huxton
  Archonet Ltd

В списке pgsql-general по дате отправления:

Предыдущее
От: "Sergey Konoplev"
Дата:
Сообщение: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: merge 2 dumps