Re: Important speed difference between a query and a

Поиск
Список
Период
Сортировка
От Frederic Jolliton
Тема Re: Important speed difference between a query and a
Дата
Msg-id 86el3rsxqu.fsf@mau.localdomain
обсуждение исходный текст
Ответ на Important speed difference between a query and a function with the same query  (Frederic Jolliton <fred-pg@jolliton.com>)
Ответы Re: Important speed difference between a query and a  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Important speed difference between a query and a  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-performance
> (PostgreSQL 7.3.2 on i386-portbld-freebsd4.7, compiled by GCC 2.95.4)
>
> I've a curious performance problem with a function returning set of
> rows.  The query alone is very fast, but not when called from the
> function.
>
> To "emulate" a parametred view, I created a function as follow:
>
> CREATE FUNCTION get_info (integer) RETURNS SETOF type_get_info
>     AS '...' <- here the query show below, where 'LIMIT $1' is used instead of 'LIMIT 10'
>     LANGUAGE sql;

Setting enable_seqscan to off give same result speed between the query
and the function !

So, the query in the function is not using index but the exact same
query alone does !

Is there an explanation ?

--
Frédéric Jolliton


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

Предыдущее
От: Frederic Jolliton
Дата:
Сообщение: Important speed difference between a query and a function with the same query
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Important speed difference between a query and a