Re: general purpose array_sort - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: general purpose array_sort
Date
Msg-id CAKFQuwbrXFUgs8R1F2wsAG_V5e2qqU0FUnuLuLjrYP9VSUZFTg@mail.gmail.com
Whole thread Raw
In response to Re: general purpose array_sort  (Aleksander Alekseev <aleksander@timescale.com>)
Responses Re: general purpose array_sort
List pgsql-hackers
On Thu, Oct 24, 2024 at 8:27 AM Aleksander Alekseev <aleksander@timescale.com> wrote:

Just making an observation / thinking out loud that the requirement to
support everything ORDER BY handles / supports (and will handle /
support?) might make this function impractical to maintain.

Particularly, does the function really need to support dir => asc |
desc | asc nulls first | etc... ? Maybe array_sort() + array_reverse(
array_sort() ) will handle most of the practical cases? I don't know.

[1]: https://commitfest.postgresql.org/50/5314/


Composing function calls here seems quite undesirable from a performance standpoint, but maybe I over-estimate the cost of exploding-manipulating-freezing an array datum.  Also, while I'm not in a good position to judge the challenge of implementing the sort parameters I would rather have them than not since the order by API has them (plus performance).  I also, maybe unreasonably, believe that our extensible type system has already limited the maintenance burden.

David J.

pgsql-hackers by date:

Previous
From: jian he
Date:
Subject: cache lookup failed when \d t concurrent with DML change column data type
Next
From: Tom Lane
Date:
Subject: Re: Better error reporting from extension scripts (Was: Extend ALTER OPERATOR)