pgsql: Rethink prior patch to filter out dead backend entries from the - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Rethink prior patch to filter out dead backend entries from the
Date
Msg-id 20051216040340.5B68B9DCA59@postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
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).

Modified Files:
--------------
    pgsql/src/backend/postmaster:
        pgstat.c (r1.112 -> r1.113)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/pgstat.c.diff?r1=1.112&r2=1.113)
    pgsql/src/backend/storage/ipc:
        procarray.c (r1.9 -> r1.10)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/storage/ipc/procarray.c.diff?r1=1.9&r2=1.10)
    pgsql/src/include/storage:
        procarray.h (r1.6 -> r1.7)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/storage/procarray.h.diff?r1=1.6&r2=1.7)

pgsql-committers by date:

Previous
From: cmaj@pgfoundry.org (User Cmaj)
Date:
Subject: pgaccess - pgaccess: Documenting some key bindings in queries.
Next
From: neilc@postgresql.org (Neil Conway)
Date:
Subject: pgsql: Fix some typos in the TODO list.