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>)
Список pgsql-performance
On Sat, Apr 10, 2010 at 4:47 PM, Ben Chobot <bench@silentmedia.com> wrote:
> My understanding is that this generally happens because the plan should be different for the different values, but
thefirst time the function is run it caches the plan for one of the values and will never use the appropriate plan for
thesecond 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 <query>;
EXPLAIN EXECUTE foo (parameters);

...Robert

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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: significant slow down with various LIMIT
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: How check execution plan of a function