Limit & offset effect on query plans

From: Amitabh Kant <amitabhkant(at)gmail(dot)com>
To: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Limit & offset effect on query plans
Date: 2012-12-13 04:08:09
Message-ID: CAPTAQBJPJK8Anraixw1iYBcGe9Rb6wZ6DxPcfiZxvmrtR7hGeQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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.

Amitabh

P.S. I haven't checked my query plans to see if there are any actual effect
of these keywords as I am still working my way through reading the output
of "Explain" ouput.

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Pavan Deolasee 2012-12-13 04:43:26 Re: Limit & offset effect on query plans
Previous Message Tom Lane 2012-12-13 03:51:38 Re: [PERFORM] encouraging index-only scans