Re: A small problem when rehashing catalog cache

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: cca5507 <cca5507(at)qq(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: A small problem when rehashing catalog cache
Date: 2025-12-17 03:35:21
Message-ID: aUIk-Sht-VsN4oZz@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 17, 2025 at 11:12:46AM +0800, cca5507 wrote:
> Although this does not affect correctness, I'd like to propose a
> patch to fix it.

That's an interesting point.

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?
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2025-12-17 03:44:11 Re: Replace is_publishable_class() with relispublishable column in pg_class
Previous Message Noah Misch 2025-12-17 03:23:57 Re: Inval reliability, especially for inplace updates