Re: UDF in C slow

Поиск
Список
Период
Сортировка
От Inanc Seylan
Тема Re: UDF in C slow
Дата
Msg-id 4FAD24B6.8040704@gmail.com
обсуждение исходный текст
Ответ на Re: UDF in C slow  (Alban Hertroys <haramrae@gmail.com>)
Ответы Re: UDF in C slow  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
It is IMMUTABLE. I attach the output of EXPLAIN both with and without
the simple function (returning true only) in the query.

On 5/11/12 4:21 PM, Alban Hertroys wrote:
> On 11 May 2012 15:57, Inanc Seylan<inanc.seylan@gmail.com>  wrote:
>> Hi all,
>>
>> I have implemented a user-defined function in C that returns a boolean value
>> after some computation. Now I have a query Q such that when I specify the
>> function in the WHERE clause of Q, Q runs in 40 secs and if I don't use the
>> function it runs in 4 secs. Then I thought that my implementation of this
>> function could be slow; so I decided to write a very simple function that
>> just returns true without any computation. To my surprise, it also takes
>> around 40 seconds to run Q with the new very simple function. Does anybody
>> have a clue about what might be going wrong?
>
> Is that a VOLATILE, STABLE or IMMUTABLE function? What's the output of
> EXPLAIN ANALYZE?


Вложения

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

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: UDF in C slow
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: avoiding CONTEXT messages