pgsql: This patch reduces the size of the message header used by

From: neilc(at)svr1(dot)postgresql(dot)org (Neil Conway)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: This patch reduces the size of the message header used by
Date: 2005-05-11 01:41:41
Message-ID: 20050511014141.668D353CE7@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
This patch reduces the size of the message header used by statistics
collector messages, per recent discussion on pgsql-patches. This
actually required quite a few changes -- for example,
"databaseid != InvalidOid" was used to check whether a slot in the
backend entry table was initialized, but that no longer works since
the slot might be initialized prior to receiving the BESTART message
which contains the database id. We now use procpid > 0 to indicate
that a slot is non-empty.

Other changes:

- various comment improvements and cleanups
- there's no need to zero-out the entire activity buffer in
pgstat_add_backend(), we can just set activity[0] to '\0'.
- remove the counting of the # of connections to a database; this
was not used anywhere

One change in behavior I wasn't sure about: previously, the code
would create a hash table entry for a database as soon as any message
was received whose header referenced that database. Now, we only
create hash table entries as needed (so for example BESTART won't
create a database hash table entry, since it doesn't need to
access anything in the per-db hash table). It would be easy enough
to retain the old behavior, but AFAICS it is not required.

Modified Files:
--------------
pgsql/src/backend/postmaster:
pgstat.c (r1.93 -> r1.94)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/postmaster/pgstat.c.diff?r1=1.93&r2=1.94)
pgsql/src/backend/utils/adt:
pgstatfuncs.c (r1.21 -> r1.22)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/pgstatfuncs.c.diff?r1=1.21&r2=1.22)
pgsql/src/include:
pgstat.h (r1.28 -> r1.29)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/pgstat.h.diff?r1=1.28&r2=1.29)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2005-05-11 02:11:06 pgsql: Add Chinese FAQ.
Previous Message Neil Conway 2005-05-11 01:26:03 pgsql: Code cleanup: in C89, there is no point casting the first