From cb98e6fb8fd4f1ca955a85d5c0088e42e77a04f0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 3 May 2006 22:45:26 +0000 Subject: Create a syscache for pg_database-indexed-by-oid, and make use of it in various places that were previously doing ad hoc pg_database searches. This may speed up database-related privilege checks a little bit, but the main motivation is to eliminate the performance reason for having ReverifyMyDatabase do such a lot of stuff (viz, avoiding repeat scans of pg_database during backend startup). The locking reason for having that routine is about to go away, and it'd be good to have the option to break it up. --- src/include/utils/syscache.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'src/include/utils/syscache.h') diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h index d3feea1f82b..34ef6132b3e 100644 --- a/src/include/utils/syscache.h +++ b/src/include/utils/syscache.h @@ -9,7 +9,7 @@ * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.62 2006/03/05 15:59:08 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/syscache.h,v 1.63 2006/05/03 22:45:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -46,22 +46,23 @@ #define CONDEFAULT 15 #define CONNAMENSP 16 #define CONOID 17 -#define INDEXRELID 18 -#define INHRELID 19 -#define LANGNAME 20 -#define LANGOID 21 -#define NAMESPACENAME 22 -#define NAMESPACEOID 23 -#define OPERNAMENSP 24 -#define OPEROID 25 -#define PROCNAMEARGSNSP 26 -#define PROCOID 27 -#define RELNAMENSP 28 -#define RELOID 29 -#define RULERELNAME 30 -#define STATRELATT 31 -#define TYPENAMENSP 32 -#define TYPEOID 33 +#define DATABASEOID 18 +#define INDEXRELID 19 +#define INHRELID 20 +#define LANGNAME 21 +#define LANGOID 22 +#define NAMESPACENAME 23 +#define NAMESPACEOID 24 +#define OPERNAMENSP 25 +#define OPEROID 26 +#define PROCNAMEARGSNSP 27 +#define PROCOID 28 +#define RELNAMENSP 29 +#define RELOID 30 +#define RULERELNAME 31 +#define STATRELATT 32 +#define TYPENAMENSP 33 +#define TYPEOID 34 extern void InitCatalogCache(void); extern void InitCatalogCachePhase2(void); -- cgit v1.2.3