Re: Sort functions with specialized comparators

x4mmm@yandex-team.ru

From: Andrey Borodin <x4mmm@yandex-team.ru>
To: John Naylor <johncnaylorls@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>, Антуан Виолин <violin.antuan@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2025-01-14T09:22:42Z
Lists: pgsql-hackers

> On 14 Jan 2025, at 13:58, John Naylor <johncnaylorls@gmail.com> wrote:
> 
> That's not as clear-cut as I thought. To avoid regressions, I've gone
> back to an earlier idea to pass the direction to the comparator, but
> this time keep it simple by using the same comparator for sort and
> unique, similar to v9.

Looks good to me.
Nice stats for some cleaning up 34 insertions(+), 48 deletions(-).


Best regards, Andrey Borodin.



Commits

  1. Specialize intarray sorting

  2. Replace insertion sort in contrib/intarray with qsort().