Re: 'cost' and 'rows' for volitile function

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: 'cost' and 'rows' for volitile function
Дата
Msg-id 4A2D4B8B.1080501@archonet.com
обсуждение исходный текст
Ответ на 'cost' and 'rows' for volitile function  (Rob Sargent <robjsargent@gmail.com>)
Список pgsql-sql
Rob Sargent wrote:
> Richard Huxton wrote:
>> Rob Sargent wrote:
>>> pg-admin is showing 'COST 100' and 'ROWS 1000' for my explicitly 
>>> VOLATILE functions. 

> Thanks for the pointer back to CREATE FUNCTION docs.  That would have 
> told me that those value are indeed the defaults.  I guess I'm somewhat 
> surprised that they are in fact defautled.  "COST" is too arbitrary for 
> me to comment on, but my functions' results sets fall on both sides of 
> 1000 rows, so I'm not sure giving this value to the planner does a lot 
> of good.  Luckily, my functions are typically pretty much stand-alone 
> calls, and not part of some larger query.

If your functions are all called at the top-level then indeed it doesn't 
matter. At a low level though, telling the planner function F1 costs 
1000 times more than F2 is useful.

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: Rob Sargent
Дата:
Сообщение: 'cost' and 'rows' for volitile function
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: 'cost' and 'rows' for volitile function