Re: Sort functions with specialized comparators - Mailing list pgsql-hackers

From John Naylor
Subject Re: Sort functions with specialized comparators
Date
Msg-id CANWCAZZGgzrZM2GK6p91AYqzxZT8vRs--TzdFyHeJQC9101Xbg@mail.gmail.com
Whole thread Raw
In response to Re: Sort functions with specialized comparators  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Tue, Jan 7, 2025 at 12:47 AM Nathan Bossart <nathandbossart@gmail.com> wrote:
>
> On Mon, Jan 06, 2025 at 05:54:29PM +0700, John Naylor wrote:
> > Those functions from common/int.h are probably not good when inlined
> > (see comment there).
>
> +1.  In fact, I think this comment was added because of the ST_MED3()
> function in sort_template.h [0].  IIRC clang handles this just fine, but
> gcc does not.
>
> [0] https://postgr.es/m/20240212230423.GA3519%40nathanxps13

Yeah. If it were just med3, it would probably be okay, but I remember
earlier experiments (also gcc) where branch-free comparators seemed to
not work well with our partitioning scheme.

--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: Nisha Moond
Date:
Subject: Re: Conflict detection for update_deleted in logical replication
Next
From: "Andrey M. Borodin"
Date:
Subject: Re: Sort functions with specialized comparators