Re: Use bsearch() instead of a manual binary search in syscache.c

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Antonin Houska <ah(at)cybertec(dot)at>
Cc: cca5507(at)qq(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Use bsearch() instead of a manual binary search in syscache.c
Date: 2025-11-08 13:24:34
Message-ID: CA+hUKG+eksTwB+uDNk3Go83+LBy=kAxC2GjKvxzu-do_ZnXTcQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Nov 9, 2025 at 1:12 AM Antonin Houska <ah(at)cybertec(dot)at> wrote:
> cca5507 <cca5507(at)qq(dot)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().

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Manni Wood 2025-11-08 14:05:49 Re: [PATCH] Add pg_get_tablespace_ddl() function to reconstruct CREATE TABLESPACE statement
Previous Message Joel Jacobson 2025-11-08 12:59:21 Re: Optimize LISTEN/NOTIFY