]> granicus.if.org Git - postgresql/commit
Fix a performance problem in databases with large numbers of tables
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 11 Jan 2007 23:06:16 +0000 (23:06 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 11 Jan 2007 23:06:16 +0000 (23:06 +0000)
commit0069d7c36acea96f6c3ca7585e9e7ce1501d8d7e
treec75bdbb27f907c6a6e608581a127cf88fce6362b
parente6be37ffe2ca736378c9c4608ee8f8b2e11189b9
Fix a performance problem in databases with large numbers of tables
(or other types of pg_class entry): the function pgstat_vacuum_tabstat,
invoked during VACUUM startup, had runtime proportional to the number of
stats table entries times the number of pg_class rows; in other words
O(N^2) if the stats collector's information is reasonably complete.
Replace list searching with a hash table to bring it back to O(N)
behavior.  Per report from kim at myemma.com.

Back-patch as far as 8.1; 8.0 and before use different coding here.
src/backend/postmaster/pgstat.c