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 491993D5.3070701@archonet.com
обсуждение исходный текст
Ответ на 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:
>> 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?
>>
>
> Sorry, but it seems like you didn't understand the problem.
>
> The thing is that
>
> EXPLAIN (without ANALYZE) ... NOT IN (a lot of values)
>
> works very slow but
>
> EXPLAIN (without ANALYZE) ... IN (a lot of values)
>
> works fast.

It's the EXPLAIN that you're finding slow? Hold on... not seeing it here.


------------------------------------------
Testing EXPLAIN w/ NOT IN...
------------------------------------------
100 ids: 95 ms
200 ids: 15 ms
300 ids: 17 ms
400 ids: 19 ms
500 ids: 20 ms
600 ids: 21 ms
700 ids: 23 ms
800 ids: 27 ms
900 ids: 26 ms
1000 ids: 27 ms
1100 ids: 29 ms
1200 ids: 30 ms
1300 ids: 33 ms
1400 ids: 45 ms
1500 ids: 35 ms
1600 ids: 37 ms
1700 ids: 39 ms
1800 ids: 40 ms
1900 ids: 42 ms
2000 ids: 44 ms

------------------------------------------
Testing EXPLAIN w/ IN...
------------------------------------------
100 ids: 15 ms
200 ids: 16 ms
300 ids: 17 ms
400 ids: 20 ms
500 ids: 21 ms
600 ids: 23 ms
700 ids: 25 ms
800 ids: 27 ms
900 ids: 28 ms
1000 ids: 33 ms
1100 ids: 32 ms
1200 ids: 34 ms
1300 ids: 35 ms
1400 ids: 38 ms
1500 ids: 39 ms
1600 ids: 41 ms
1700 ids: 43 ms
1800 ids: 48 ms
1900 ids: 47 ms
2000 ids: 48 ms

--
  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: Very slow queries w/ NOT IN preparation (seems like a bug, test case)