Re: A small problem when rehashing catalog cache

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: cca5507 <cca5507(at)qq(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: A small problem when rehashing catalog cache
Date: 2026-01-05 08:30:43
Message-ID: CANWCAZYDCUadH4D-vX7dH0HibE-zTGfLRvc2dwrgJwr1-3zD8w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 17, 2025 at 10:35 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
> Indeed, the code bothers putting a fresh matching entry at the
> beginning of a bucket, and the code does the opposite when moving
> entries around, which is inconsistent to say the least. If we move
> the entries at the tail instead as you are suggesting the "freshness"
> would be preserved better. This deserves a comment, at least.
>
> 20cb18db4668 has added the RehashCatCache() part, with 473182c9523a
> copying the same pattern for RehashCatCacheLists().
>
> Thoughts or opinions from others?

I suspect it doesn't make much difference in the grand scheme of
things, but the code has to do either one thing or the other, so +1 to
do the more sensible thing.

--
John Naylor
Amazon Web Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2026-01-05 08:38:37 Re: Decouple C++ support in Meson's PGXS from LLVM enablement
Previous Message Hayato Kuroda (Fujitsu) 2026-01-05 08:24:57 RE: Patch for migration of the pg_commit_ts directory