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

From Ivan Sergio Borgonovo
Subject is it helpful for the optimiser/planner to add LIMIT 1
Date
Msg-id 20080403122843.5e1c74ba@webthatworks.it
Whole thread Raw
Responses Re: is it helpful for the optimiser/planner to add LIMIT 1  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-general
I'm reviewing some function I wrote to add stable, immutable where
needed and I'd like to take the chance to add further "cheap"
optimisation if it helps.

There are many places where I know a function or a statement will
return just one row?

Is it helpful to add LIMIT 1?

eg.
select a, b from myfunction(3,5) limit 1;
select into a,b x,y from tablename where z=5 and u=7 limit 1;
select a,b from from tablename where z=5 and u=7 limit 1;

thx


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


pgsql-general by date:

Previous
From: "Ian Sillitoe"
Date:
Subject: Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'
Next
From: windwxc@sina.com
Date:
Subject: question about complex type