diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-16 04:03:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-12-16 04:03:40 +0000 |
commit | fb3dbdf986f0ab56e0a5177966bb0dec1f93444c (patch) | |
tree | e2d938afc400167c0b62d49bf37ed825ae0cbd70 /src/tutorial | |
parent | 4ce6be4f5e1e4b0c89c5c8de179e3fa8216a7b54 (diff) | |
download | postgresql-fb3dbdf986f0ab56e0a5177966bb0dec1f93444c.tar.gz postgresql-fb3dbdf986f0ab56e0a5177966bb0dec1f93444c.zip |
Rethink prior patch to filter out dead backend entries from the pgstats
file. The original code probed the PGPROC array separately for each PID,
which was not good for large numbers of backends: not only is the runtime
O(N^2) but most of it is spent holding ProcArrayLock. Instead, take the
lock just once and copy the active PIDs into an array, then use qsort
and bsearch so that the lookup time is more like O(N log N).
Diffstat (limited to 'src/tutorial')
0 files changed, 0 insertions, 0 deletions