Re: type cache cleanup improvements

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com>
Cc: Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, Teodor Sigaev <teodor(at)sigaev(dot)ru>, Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>, Aleksander Alekseev <aleksander(at)timescale(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paquier <michael(at)paquier(dot)xyz>
Subject: Re: type cache cleanup improvements
Date: 2024-08-22 16:52:32
Message-ID: CAPpHfdvG-PzE5UN36my_4+FYv0n5rZJ-pN=z-gDCCk9ViPQ1Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

On Thu, Aug 22, 2024 at 1:02 PM Pavel Borisov <pashkin(dot)elfe(at)gmail(dot)com> wrote:
Looked at v9:
> Patch looks good to me. I'd only suggest comments changes:
>
> "The map from relation's OID to the corresponding composite type OID" -> "The mapping of relation's OID to the corresponding composite type OID"
> "We're keeping the map entry when corresponding typentry have either TCFLAGS_HAVE_PG_TYPE_DATA, or TCFLAGS_OPERATOR_FLAGS, or tupdesc. That is we're keeping map entry if the entry has something to clear." -> "We're keeping the map entry when the corresponding typentry has something to clear i.e it has either TCFLAGS_HAVE_PG_TYPE_DATA, or TCFLAGS_OPERATOR_FLAGS, or tupdesc."
> "Invalidate particular TypeCacheEntry on Relcache inval callback" - remove extra tabs before. Maybe also add empty line above.
> "Typically shouldn't be a problem" -> "Typically this shouldn't affect performance"
> "Relid = 0, so we need" -> "Relid is invalid. By convention we need"
> "if cleaned TCFLAGS_HAVE_PG_TYPE_DATA flag" -> "if we cleaned TCFLAGS_HAVE_PG_TYPE_DATA flag previously"
> "+/*
> + * Delete entry RelIdToTypeIdCacheHash if needed after resetting of the
> + * TCFLAGS_HAVE_PG_TYPE_DATA flag, or any of TCFLAGS_OPERATOR_FLAGS flags,
> + * or tupDesc if needed." - remove one "if needed"

Thank you for your feedback. I've integrated all your edits except
the formatting change of InvalidateCompositeTypeCacheEntry() header
comment. I think the functions below have the same formatting of
header comments, and it's not necessary to change format.

If no objections, I'm planning to push this after reverting PARTITION
SPLIT/MERGE.

------
Regards,
Alexander Korotkov
Supabase

Attachment Content-Type Size
v10-0001-Avoid-looping-over-all-type-cache-entries-in-Typ.patch application/octet-stream 14.2 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-08-22 17:16:10 Feature-test macros for new-in-v17 libpq features
Previous Message Tom Lane 2024-08-22 16:44:20 Re: Usage of ProcessConfigfile in SIGHUP_Handler