]> granicus.if.org Git - postgresql/commit
A bunch of changes aimed at reducing backend startup time...
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 19 Feb 2002 20:11:20 +0000 (20:11 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 19 Feb 2002 20:11:20 +0000 (20:11 +0000)
commit786340441706ac1957a031f11ad1c2e5b6e18314
tree4e6b689b96778e42e6cc679169f71dc180049e04
parent8e2998d8a6aebc2a3b22e6048fab8abe1c95f1f0
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).
33 files changed:
src/backend/access/index/genam.c
src/backend/access/index/istrat.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/indexing.c
src/backend/commands/cluster.c
src/backend/commands/command.c
src/backend/commands/trigger.c
src/backend/commands/vacuum.c
src/backend/executor/execAmi.c
src/backend/executor/execUtils.c
src/backend/executor/nodeIndexscan.c
src/backend/executor/nodeSeqscan.c
src/backend/executor/nodeTidscan.c
src/backend/optimizer/util/plancat.c
src/backend/parser/parse_func.c
src/backend/parser/parse_oper.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/cache/catcache.c
src/backend/utils/cache/inval.c
src/backend/utils/cache/relcache.c
src/backend/utils/cache/syscache.c
src/backend/utils/init/postinit.c
src/include/access/genam.h
src/include/access/istrat.h
src/include/catalog/index.h
src/include/catalog/indexing.h
src/include/executor/executor.h
src/include/storage/lwlock.h
src/include/utils/catcache.h
src/include/utils/rel.h
src/include/utils/relcache.h
src/include/utils/syscache.h