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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Дата
Msg-id 1330.1420480481@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (David G Johnston <david.g.johnston@gmail.com>)
Ответы Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Atri Sharma <atri.jiit@gmail.com>)
Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Nicolas Barbier <nicolas.barbier@gmail.com>)
Re: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
David G Johnston <david.g.johnston@gmail.com> writes:
> Atri Sharma wrote
>> If order of result rows is not the same as required, an error is raised:
>> 
>> SELECT * FROM incorrect_order_nulls() ORDER BY e NULLS LAST;
>> ERROR:  Order not same as specified

> First reaction for the error was unfavorable but (see below) it likely is
> the best option and does adequately cover the reason for failure -
> programmer error.

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.
        regards, tom lane



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: INSERT ... ON CONFLICT UPDATE and RLS
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: Redesigning checkpoint_segments