pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add cache for recomputeNamespacePath().
Date: Wed, 15 Nov 2023 02:03:29 +0000
Message-ID: <E1r35FZ-005Uxv-HL@gemulon.postgresql.org> (raw)

Add cache for recomputeNamespacePath().

When search_path is changed to something that was previously set, and
no invalidation happened in between, use the cached list of namespace
OIDs rather than recomputing them. This avoids syscache lookups and
ACL checks.

Important when the search_path changes frequently, such as when set in
proconfig.

An earlier version of this patch was reviewd by Nathan Bossart. This
version simplifies a few things and is safer in case of OOM.

Discussion: https://www.postgresql.org/message-id/abf4ce8804e0e05dff8c1725ae6a8ed28b7d66e0.camel%40j-davis.com
Reviewed-by: Nathan Bossart

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f26c2368dcaef7519d8400ca958c4b5742cdbd46

Modified Files
--------------
src/backend/catalog/namespace.c | 404 +++++++++++++++++++++++++++++++++-------
1 file changed, 341 insertions(+), 63 deletions(-)



Message-ID: <E1r35FZ-005Uxv-HL@gemulon.postgresql.org>
Permalink:  ../E1r35FZ-005Uxv-HL@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1r35FZ-005Uxv-HL@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add cache for recomputeNamespacePath().
  In-Reply-To: <E1r35FZ-005Uxv-HL@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox