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

Поиск
Список
Период
Сортировка
От Sergey Konoplev
Тема Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Дата
Msg-id c3a7de1f0811110807i5b010bdrc1c7856d107cbf50@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Richard Huxton <dev@archonet.com>)
Ответы Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Richard Huxton <dev@archonet.com>)
Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
>> I did \timing and run my query in console. You can find the result in
>> attachement. Will it be enough?
>
> Very strange.
>
> The explain runtime is 3.1 seconds, but \timing shows 37.8 seconds
> before it returns.
>
> And it only does this for the NOT IN version of the query, but the IN
> version seems OK.
>

Exactly.

> The two together make no sense to me.
>
> If you do the same again but "\o /dev/null" before the /timing, is it
> still slow?

Unfortunaly it is.
\o /dev/null
Time: 38337,644 ms

> If not, what about "\o /tmp/results.txt"?

The same.
Time: 37631,055 ms

> That should rule out something strange with displaying a very long line
> (and I admit I'm reduced to wild guesses now).

I had that wild guess too and tested it after separating ID's list to
10 per line but result is the same.

> If you run it over the network, can you try running it directly on the
> server?

I'm running it directly on my machine. But I tested it remotely too.

> Finally - did you compile this from source yourself, or is it installed
> via apt? I'm wondering whether you have an unusual version of a library
> linked in, and it's taking a long time to parse the query.

I've compiled it from sources. BTW, I tested it on both 8.3.3 and 8.3.4.

> Actually, we can test that. If you run the same query against an empty
> table, does it take more than a few milliseconds?

Yes it does. Nothing has changed.

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

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

Предыдущее
От: Vaclav TVRDIK
Дата:
Сообщение: Timestamp precission question
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Very slow queries w/ NOT IN preparation (seems like a bug, test case)