Re: is it helpful for the optimiser/planner to add LIMIT 1 - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: is it helpful for the optimiser/planner to add LIMIT 1
Date
Msg-id 20080403173254.4852cca7@webthatworks.it
Whole thread Raw
In response to Re: is it helpful for the optimiser/planner to add LIMIT 1  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: is it helpful for the optimiser/planner to add LIMIT 1  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
On Thu, 03 Apr 2008 10:33:56 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Gregory Stark <stark@enterprisedb.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


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: is it helpful for the optimiser/planner to add LIMIT 1
Next
From: rihad
Date:
Subject: deadlock