]> granicus.if.org Git - postgresql/commit
Adjust pgstat_initstats() to avoid repeated searches of the TabStat arrays
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 21 Apr 2007 04:10:53 +0000 (04:10 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 21 Apr 2007 04:10:53 +0000 (04:10 +0000)
commit11da4c671ea6391c59ed5f465e390c6635e54cf4
tree17f7b8bb6e854b778d6d16f70434d97fa85cf27d
parentca3d14f2a98b49d989090c800835b80087286cb4
Adjust pgstat_initstats() to avoid repeated searches of the TabStat arrays
when a relation is opened multiple times in the same transaction.  This is
particularly useful for system catalogs, which we may heap_open or index_open
many times in a transaction, and it doesn't really cost anything extra even
if the rel is touched but once.  Motivated by study of an example from Greg
Stark, in which pgstat_initstats() accounted for an unreasonably large
fraction of the runtime.
src/backend/postmaster/pgstat.c