Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Дата
Msg-id CA+TgmoZGbexC4=Nt6Ovw_RpGPMB6N5v7Lk3HnGa90aSaS0Fpsg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Mon, Jan 5, 2015 at 12:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> TBH, my first reaction to this entire patch is unfavorable: it's a
> solution in search of a problem.  It adds substantial complication not
> only for users but for PG developers in order to solve a rather narrow
> performance issue.
>
> What would make sense to me is to teach the planner about inlining
> SQL functions that include ORDER BY clauses, so that the performance
> issue of a double sort could be avoided entirely transparently to
> the user.

That's not a bad idea, but it only helps for SQL functions.  Actually,
the problem I have run into in the past was not that the planner
didn't know the ordering of the SRF's return value, but that it had no
statistics for it, and therefore made bad optimization decisions.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Sawada Masahiko
Дата:
Сообщение: Re: Merging postgresql.conf and postgresql.auto.conf
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Compression of full-page-writes