Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2150: PL/Python function delcared STABLE gets run repeatedly
Дата
Msg-id 8818.1136565757@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2150: PL/Python function delcared STABLE gets run repeatedly  ("Aaron Swartz" <me@aaronsw.com>)
Список pgsql-bugs
"Aaron Swartz" <me@aaronsw.com> writes:
> We have the PL/Python function get_foo(n) that returns an array. If this
> function is declared IMMUTABLE, then:
> SELECT * FROM tablenamehere WHERE id = any(get_foo(21));
> returns quickly. If the function is declared STABLE, however, PostgreSQL
> seems to incorrectly run it for every row in the table and it takes forever.

= ANY isn't indexable in 8.1, so there's no obvious reason why either
version would be fast.  You're going to have to provide more detail if
you want help.  For starters, what does EXPLAIN ANALYZE show in each
case?  What's the schema of the table (\d output will do)?

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2153: atan2(0, 0) ERROR: input is out of range on Solaris
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #2152: psql crash reproducible