pgsql: Add cache for recomputeNamespacePath().

From: Jeff Davis <jdavis(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add cache for recomputeNamespacePath().
Date: 2023-11-15 02:03:29
Message-ID: E1r35FZ-005Uxv-HL@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2023-11-15 10:11:27 pgsql: Fix dsa.c with different resource owners.
Previous Message Michael Paquier 2023-11-15 00:46:11 pgsql: doc: Improve description of targets for pg_stat_reset_shared()