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

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема is it helpful for the optimiser/planner to add LIMIT 1
Дата
Msg-id 20080403122843.5e1c74ba@webthatworks.it
обсуждение исходный текст
Ответы Re: is it helpful for the optimiser/planner to add LIMIT 1  (Gregory Stark <stark@enterprisedb.com>)
Список 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 по дате отправления:

Предыдущее
От: "Ian Sillitoe"
Дата:
Сообщение: Re: (FAQ?) JOIN condition - 'WHERE NULL = NULL'
Следующее
От: windwxc@sina.com
Дата:
Сообщение: question about complex type