Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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:
        pgstat.c (r1.93 -> r1.94)
        pgstatfuncs.c (r1.21 -> r1.22)
        pgstat.h (r1.28 -> r1.29)

pgsql-committers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group