Re: Use bsearch() instead of a manual binary search in syscache.c - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: Use bsearch() instead of a manual binary search in syscache.c
Date
Msg-id CA+hUKG+eksTwB+uDNk3Go83+LBy=kAxC2GjKvxzu-do_ZnXTcQ@mail.gmail.com
Whole thread Raw
In response to Re: Use bsearch() instead of a manual binary search in syscache.c  (Antonin Houska <ah@cybertec.at>)
Responses Re: Use bsearch() instead of a manual binary search in syscache.c
List pgsql-hackers
On Sun, Nov 9, 2025 at 1:12 AM Antonin Houska <ah@cybertec.at> wrote:
> cca5507 <cca5507@qq.com> wrote:
> > I make a patch for the $subject, which make the code simpler, thoughts?
>
> I proposed something like that earlier [1] but did not get too far. The short
> discussion might be useful for you though.

One factor is that libc bsearch() implementations might not all be
header-only and inlineable.  I vaguely recall that being discussed in
some round of hacking on qsort() and qunique().



pgsql-hackers by date:

Previous
From: "Joel Jacobson"
Date:
Subject: Re: Optimize LISTEN/NOTIFY
Next
From: Manni Wood
Date:
Subject: Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement