Re: function performs differently with different values

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: function performs differently with different values
Дата
Msg-id
i2n603c8f071004120621s63a45e1az1b8b2df0a9fb52c4@mail.gmail.com
Ответ на
Список
Дерево обсуждения
function performs differently with different values Ben Chobot <bench@silentmedia.com>
Re: function performs differently with different values Robert Haas <robertmhaas@gmail.com>
On Sat, Apr 10, 2010 at 4:47 PM, Ben Chobot  wrote:
> My understanding is that this generally happens because the plan should be different for the different values, but the first time the function is run it caches the plan for one of the values and will never use the appropriate plan for the second value.

No, it plans based on a sort of "generic value", not the first one you
supply.  The way to get at that plan is:

PREPARE foo AS ;
EXPLAIN EXECUTE foo (parameters);

...Robert
В списке pgsql-performance по дате отправления
От: Kevin Grittner
Дата:
От: Kevin Grittner
Дата:
FAQ