Re: AW: Three types of functions, ala function redux.

Поиск
Список
Период
Сортировка
От mlw
Тема Re: AW: Three types of functions, ala function redux.
Дата
Msg-id 3A41F74C.A94890B1@mohawksoft.com
обсуждение исходный текст
Ответ на AW: Three types of functions, ala function redux.  (Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>)
Ответы Re: AW: Three types of functions, ala function redux.  (Michael Fork <mfork@toledolink.com>)
Список pgsql-hackers
Zeugswetter Andreas SB wrote:
> 
> > select * from table where col = function() ;
> 
> > (2) "function()" returns a number of values that are independent of the
> > query. Postgres should be able to optimize this to be: "select * from
> > table where col in (val1, val2, val3, ..valn)." I guess Postgres can
> > loop until done, using the isDone flag?
> 
> I think the above needs a different sql statement to begin with.
> The "= function()" clearly states that function is only allowed to return one row.
> 
> The following syntax currently works, and is imho sufficient:
>         select * from table where col in (select function());

Both syntaxes work, but always force a table scan. If you have an index
on 'col' it will not be used. If your table has millions of records,
this takes time.

-- 
http://www.mohawksoft.com


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Larry Rosenman
Дата:
Сообщение: Re: CIDR output format
Следующее
От: Thomas Lockhart
Дата:
Сообщение: Re: AW: PostgreSQL pre-7.1 Linux/Alpha Status...