Re: Limit & offset effect on query plans

Поиск
Список
Период
Сортировка
Искать
От
Pavan Deolasee
Тема
Re: Limit & offset effect on query plans
Дата
Msg-id
CABOikdMW8xO4NpigJz+9ruFjMhNp=c=6fU5ms6LGMdGmzDqbjQ@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Limit & offset effect on query plans Amitabh Kant <amitabhkant@gmail.com>
Re: Limit & offset effect on query plans Pavan Deolasee <pavan.deolasee@gmail.com>
On Thu, Dec 13, 2012 at 9:38 AM, Amitabh Kant  wrote:
> Hi
>
> Our scripts automatically add "LIMIT ALL" & "OFFSET 0" to every select query
> if no values are passed on for these parameters. I  remember reading through
> the mailing list that it's better not to pass them if they are not needed as
> they add a cost to the query plan. Is this the case, or am i looking at a
> very minor optimization.
>

I would tend to think that is the latter. While undoubtedly
limit/offset clause will add another node during query planning and
execution, AFAICS the OFFSET 0 and LIMIT ALL cases are optimized to a
good extent. So the overhead of having them will not be significant.

Thanks,
Pavan

-- 
Pavan Deolasee
http://www.linkedin.com/in/pavandeolasee

В списке pgsql-performance по дате отправления
От: Amitabh Kant
Дата:
От: Hari Babu
Дата:
FAQ