Re: POC, WIP: OR-clause support for indexes - Mailing list pgsql-hackers

From Alena Rybakina
Subject Re: POC, WIP: OR-clause support for indexes
Date
Msg-id b83dd728-3e3f-4efc-8086-b181f27dae86@postgrespro.ru
Whole thread Raw
In response to Re: POC, WIP: OR-clause support for indexes  (Alena Rybakina <a.rybakina@postgrespro.ru>)
List pgsql-hackers
On 28.03.2025 15:23, Alena Rybakina wrote:

I agree with your code in general, but to be honest, double qsort confused me a little. 

I understood why it is needed - we need to sort the elements so that they stand next to each other if they can be assigned to the same group, and then sort the groups themselves according to the set identifier. 

I may be missing something, but in the worst case we can get the complexity of qsort O(n^2), right? And I saw the letter where you mentioned this, but it is possible to use mergesort algorithm  instead of qsort, which in the worst case gives n * O(n) complexity?

No, sorry, I was wrong here and it is impossible to rewrite it this way. I apologize, I agree with your code.
-- 
Regards,
Alena Rybakina
Postgres Professional

pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Test to dump and restore objects left behind by regression
Next
From: Andres Freund
Date:
Subject: Re: AIO v2.5