Re: ORDER BY ... LIMIT.. performance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ORDER BY ... LIMIT.. performance
Дата
Msg-id 2707.1039125609@sss.pgh.pa.us
обсуждение исходный текст
Ответ на ORDER BY ... LIMIT.. performance  ("john cartmell" <john.cartmell@mediaburst.co.uk>)
Список pgsql-performance
"john cartmell" <john.cartmell@mediaburst.co.uk> writes:
> Without the LIMIT clause the query takes approximately 3-5 seconds to
> return.
> If total number of rows returned without the LIMIT clause is greater
> than 20 records, then the above query also takes th same amount of time.
> But if the the total number of rows is 20 or less then the time taken
> for the above query to return goes up to 20-30 seconds.

What does EXPLAIN (or better EXPLAIN ANALYZE) show for these various
cases?  Evidently the planner is shifting to a different plan because
of the small LIMIT, but with no details it's hard to say anything
useful.

            regards, tom lane

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

Предыдущее
От: Vernon Wu
Дата:
Сообщение: Re: Is a better way to have the same result of this query?
Следующее
От: Jochem van Dieten
Дата:
Сообщение: Re: Is a better way to have the same result of this query?