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

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Дата
Msg-id CAFjFpRc6nDdOzWvZ40OXQji-oLXTHJ8fTAVQW8AsXi=GaiumnA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Atri Sharma <atri.jiit@gmail.com>)
Ответы Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
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  (David G Johnston <david.g.johnston@gmail.com>)
Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs  (Jim Nasby <Jim.Nasby@BlueTreble.com>)
Список pgsql-hackers


On Tue, Jan 6, 2015 at 12:23 PM, Atri Sharma <atri.jiit@gmail.com> wrote:


The overhead of this patch is small. A new path is added for the preorder keys, and OrderCheck node's additional cost is pretty low, given that it only compares two rows and stores only a single row (previous row seen), hence the memory footprint is minuscule.


We can eliminate the new node and put onus or having the right order on the user like we do with volatile setting of the function.
 

That is exactly what the new node does, since we are not re sorting right now in case the order is wrong. Please see my explanation upthread, OrderCheck node's primary purpose is to check for a user error in the result rows order. The onus right now to give correct order is on user.


Even checking whether the output of the function is in the right order or not, has its cost. I am suggesting that we can eliminate this cost as well. For example, PostgreSQL does not check whether a function is really immutable or not.
 
Regards,

Atri 
--
Regards,
 
Atri
l'apprenant



--
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company

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

Предыдущее
От: Atri Sharma
Дата:
Сообщение: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs
Следующее
От: Amit Langote
Дата:
Сообщение: Re: Patch to add functionality to specify ORDER BY in CREATE FUNCTION for SRFs