summaryrefslogtreecommitdiff
path: root/src/include/utils/syscache.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-02-19 20:11:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-02-19 20:11:20 +0000
commit786340441706ac1957a031f11ad1c2e5b6e18314 (patch)
tree4e6b689b96778e42e6cc679169f71dc180049e04 /src/include/utils/syscache.h
parent8e2998d8a6aebc2a3b22e6048fab8abe1c95f1f0 (diff)
A bunch of changes aimed at reducing backend startup time...
Improve 'pg_internal.init' relcache entry preload mechanism so that it is safe to use for all system catalogs, and arrange to preload a realistic set of system-catalog entries instead of only the three nailed-in-cache indexes that were formerly loaded this way. Fix mechanism for deleting out-of-date pg_internal.init files: this must be synchronized with transaction commit, not just done at random times within transactions. Drive it off relcache invalidation mechanism so that no special-case tests are needed. Cache additional information in relcache entries for indexes (their pg_index tuples and index-operator OIDs) to eliminate repeated lookups. Also cache index opclass info at the per-opclass level to avoid repeated lookups during relcache load. Generalize 'systable scan' utilities originally developed by Hiroshi, move them into genam.c, use in a number of places where there was formerly ugly code for choosing either heap or index scan. In particular this allows simplification of the logic that prevents infinite recursion between syscache and relcache during startup: we can easily switch to heapscans in relcache.c when and where needed to avoid recursion, so IndexScanOK becomes simpler and does not need any expensive initialization. Eliminate useless opening of a heapscan data structure while doing an indexscan (this saves an mdnblocks call and thus at least one kernel call).
Diffstat (limited to 'src/include/utils/syscache.h')
-rw-r--r--src/include/utils/syscache.h54
1 files changed, 28 insertions, 26 deletions
diff --git a/src/include/utils/syscache.h b/src/include/utils/syscache.h
index 5e7b2d864ff..6164c02b152 100644
--- a/src/include/utils/syscache.h
+++ b/src/include/utils/syscache.h
@@ -9,7 +9,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: syscache.h,v 1.36 2001/11/05 17:46:36 momjian Exp $
+ * $Id: syscache.h,v 1.37 2002/02/19 20:11:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -30,33 +30,35 @@
#define AGGNAME 0
#define AMNAME 1
-#define AMOPOPID 2
-#define AMOPSTRATEGY 3
-#define AMPROCNUM 4
-#define ATTNAME 5
-#define ATTNUM 6
-#define CLAAMNAME 7
-#define CLAOID 8
-#define GRONAME 9
-#define GROSYSID 10
-#define INDEXRELID 11
-#define INHRELID 12
-#define LANGNAME 13
-#define LANGOID 14
-#define OPERNAME 15
-#define OPEROID 16
-#define PROCNAME 17
-#define PROCOID 18
-#define RELNAME 19
-#define RELOID 20
-#define RULENAME 21
-#define SHADOWNAME 22
-#define SHADOWSYSID 23
-#define STATRELATT 24
-#define TYPENAME 25
-#define TYPEOID 26
+#define AMOID 2
+#define AMOPOPID 3
+#define AMOPSTRATEGY 4
+#define AMPROCNUM 5
+#define ATTNAME 6
+#define ATTNUM 7
+#define CLAAMNAME 8
+#define CLAOID 9
+#define GRONAME 10
+#define GROSYSID 11
+#define INDEXRELID 12
+#define INHRELID 13
+#define LANGNAME 14
+#define LANGOID 15
+#define OPERNAME 16
+#define OPEROID 17
+#define PROCNAME 18
+#define PROCOID 19
+#define RELNAME 20
+#define RELOID 21
+#define RULENAME 22
+#define SHADOWNAME 23
+#define SHADOWSYSID 24
+#define STATRELATT 25
+#define TYPENAME 26
+#define TYPEOID 27
extern void InitCatalogCache(void);
+extern void InitCatalogCachePhase2(void);
extern HeapTuple SearchSysCache(int cacheId,
Datum key1, Datum key2, Datum key3, Datum key4);