Re: Bad performance of SELECT ... where id IN (...)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bad performance of SELECT ... where id IN (...)
Дата
Msg-id 22763.1253984637@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bad performance of SELECT ... where id IN (...)  (Xia Qingran <qingran.xia@gmail.com>)
Ответы Re: Bad performance of SELECT ... where id IN (...)  (Xia Qingran <qingran.xia@gmail.com>)
Список pgsql-performance
Xia Qingran <qingran.xia@gmail.com> writes:
> I have a big performance problem in my SQL select query:
> select * from event where user_id in
> (500,499,498, ... ,1,0);
> The above SELECT always spends 1200ms.

Your EXPLAIN ANALYZE shows that the actual runtime is only about 240ms.
So either the planning time is about 1000ms, or transmitting and
displaying the 134K rows produced by the query takes that long, or some
combination of the two.  I wouldn't be too surprised if it's the data
display that's slow; but if it's the planning time that you're unhappy
about, updating to a more recent PG release might possibly help.  What
version is this anyway?

            regards, tom lane

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

Предыдущее
От: Gerhard Wiesinger
Дата:
Сообщение: Re: PG 8.3 and large shared buffer settings
Следующее
От: Pierre Frédéric Caillaud
Дата:
Сообщение: Re: PG 8.3 and large shared buffer settings