Re: LIMIT clause optimization

Поиск
Список
Период
Сортировка
От Holger Klawitter
Тема Re: LIMIT clause optimization
Дата
Msg-id 200301071344.53094.lists@klawitter.de
обсуждение исходный текст
Ответ на LIMIT clause optimization  (Felipe Schnack <felipes@ritterdosreis.br>)
Ответы Re: LIMIT clause optimization  (Felipe Schnack <felipes@ritterdosreis.br>)
Список pgsql-general
Am Dienstag, 7. Januar 2003 12:47 schrieb Felipe Schnack:
>   I was wondering... (a newbie starting to understand how to optimize
> queries)
>   In which step of query execution the LIMIT clause is executed? I mean
> I have a query that would return, let's say, 6 rows, but I add a "LIMIT
> 1" in the end of it.
>   I would speed up things because I would have less data fetching from
> the database, right?

Limit kicks in quite late as it has to be done after sorting. And it is not
recommended to use LIMIT without ORDER BY.

With kind regards / mit freundlichem Gruß
    Holger Klawitter
--
Holger Klawitter                          http://www.klawitter.de
lists@klawitter.de

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

Предыдущее
От: Achilleus Mantzios
Дата:
Сообщение: Re: [SQL] 7.3.1 index use / performance
Следующее
От: Felipe Schnack
Дата:
Сообщение: Re: LIMIT clause optimization