Re: LIMIT causes huge slow down

Поиск
Список
Период
Сортировка
От David Johnston
Тема Re: LIMIT causes huge slow down
Дата
Msg-id 1394642071713-5795717.post@n5.nabble.com
обсуждение исходный текст
Ответ на Re: LIMIT causes huge slow down  (Harry Rossignol <harrywr2@comcast.net>)
Ответы Re: LIMIT causes huge slow down  (Grégory Giannoni <greg@wmaker.net>)
Список pgsql-bugs
Harry Rossignol wrote
> hello
>
> i am just a lowly application developer, but i always include my 'where'
> fields in my order by specification.
> I.E. ORDER BY id_webzine,id_flickr,id_picasa,id_photo rather then just
> id_photo

You really should consider thinking about what you need rather than blindly
adhering to a rule that puts additional burden on the system when it may not
be necessary.

WRT to question posed: probably the easiest workaround is to move the
unlimited query to a WITH clause and then apply the limit separately.

You should indicate what version of PostgreSQL you are using.

Sorry I'm not much help on the how and why of the actual plan choices here.
The sorting is constant but since the limit and the where clause target
different tables a full evaluation is needed to determine a solution so
picking individual rows, which is what I see happening, doesn't by you
anything.

But, for all I know your using an old version and this undesirable behavior
has already been found and fixed.

David J.





--
View this message in context:
http://postgresql.1045698.n5.nabble.com/LIMIT-causes-huge-slow-down-tp5795640p5795717.html
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

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

Предыдущее
От: Rainer Tammer
Дата:
Сообщение: Re: Problem with PostgreSQL 9.2.7 and make check on AIX 7.1
Следующее
От: Joyce.Kai@honeywell.com
Дата:
Сообщение: BUG #9548: jpg error 53 when trying to view jpg stored in blob field