Re: Function Scan costs

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Function Scan costs
Дата
Msg-id 1340840031.32226.12.camel@sussancws0025
обсуждение исходный текст
Ответ на Function Scan costs  (Andy Halsall <halsall_andy@hotmail.com>)
Ответы Re: Function Scan costs  (Andy Halsall <halsall_andy@hotmail.com>)
Список pgsql-novice
On Wed, 2012-06-27 at 15:56 +0000, Andy Halsall wrote:
> I'm calling functions via libpq. I've noticed that in the EXPLAIN
> analysis the time for the Function Scan is high relative to that of
> the actual query. In the example below (if I'm reading it correctly),
> the query seems to take just 0.022 ms whereas the time allocated to
> "Function Scan is 0.483ms. Is this to do with parsing original query
> and substituting params? Could somebody please explain? Thanks.

The times involved are quite small so it's hard to speculate on exactly
what's causing the difference (if there is a real difference).

If I had to guess, I would say that it's because a set-returning
function (SRF) always materializes the entire result. That's a
limitation of SRFs, and you might consider a foreign table instead if it
suits your needs.

Regards,
    Jeff Davis



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: The use of cpu_index_tuple_cost by the query planner
Следующее
От: Antonio Carlos Salzvedel Furtado Junior
Дата:
Сообщение: Re: The use of cpu_index_tuple_cost by the query planner