aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial/funcs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-12-16 04:03:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-12-16 04:03:40 +0000
commitfb3dbdf986f0ab56e0a5177966bb0dec1f93444c (patch)
treee2d938afc400167c0b62d49bf37ed825ae0cbd70 /src/tutorial/funcs.c
parent4ce6be4f5e1e4b0c89c5c8de179e3fa8216a7b54 (diff)
downloadpostgresql-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/funcs.c')
0 files changed, 0 insertions, 0 deletions