Immutable function with bind value

Поиск
Список
Период
Сортировка
От Brice Maron
Тема Immutable function with bind value
Дата
Msg-id CAHBQ7mfXsJOj6QQLm1mV6sBoZ0YA4YBdruKbGwi5KogURu8BFA@mail.gmail.com
обсуждение исходный текст
Ответы Re: Immutable function with bind value  (Matteo Beccati <php@beccati.com>)
Список pgsql-general
Hi,

i've discovered something kind of weird  while developing my app...
I was trying to fetch some records in a table using a function immutable.
In my interface it was really slow and while i was in a psql it was
really fast ...

After some research i've found out that it was caused by the bind
parameter "forcing" the immutable function to execute each time my
query gets a record.

while i know that the value can't be known at planning time the
difference between the binded / not binded is quite enormous...

i've isolated a test case here....

https://gist.github.com/e93792540cb3a68054c9

(it happens at least in pg 8.4 and 9.1.2)


What do you think about it... bug? feature?  how can i avoid it?


Thanks

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

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Re: On duplicate ignore
Следующее
От: pasman pasmański
Дата:
Сообщение: Feature request: pgsql's CASE...WHEN optimization