Re: is it helpful for the optimiser/planner to add LIMIT 1

From: Ivan Sergio Borgonovo <mail(at)webthatworks(dot)it>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: is it helpful for the optimiser/planner to add LIMIT 1
Date: 2008-04-03 15:32:54
Message-ID: 20080403173254.4852cca7@webthatworks.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 03 Apr 2008 10:33:56 -0400
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Gregory Stark <stark(at)enterprisedb(dot)com> writes:
> > You could fix that more cleanly with "ALTER FUNCTION myfunction
> > ROWS 1" but only if that's always true, not just for
> > myfunction(3,5).
>
> Perhaps the function shouldn't be declared SETOF in the first place?

Does I have to take it as:
if it is not declared as SETOF all optimisation and planning marvels
will happen without I add LIMIT 1?

What about queries?
Is it an information that is used for anything else other than
stopping earlier?

Summarising it up: is it worth to add it here and there as an
optimisation flag?

thanks

--
Ivan Sergio Borgonovo
http://www.webthatworks.it

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Dunstan 2008-04-03 15:33:05 Re: modules
Previous Message Mark Mielke 2008-04-03 15:32:37 Re: [GENERAL] SHA1 on postgres 8.3