Neil Conway <neilc@samurai.com> writes:
> How about changing the statistics collector so that we only include a
> row in the statistics view when we receive the BESTART message?
I'd vote against that. The mechanism is lossy by design and so we
must design on the assumption that we will sometimes lose the BESTART
message. I don't think it's acceptable to refuse to display information
we do have (queries, access counts) just because we don't have every
element of a rather-arbitrarily-chosen view row.
> would mean the BESTART message could include backend-start metadata
> (user ID, database ID, client address), and all other messages would
> only need enough header data to identify the backend process they are
> associated with (so perhaps backend id and process id).
Looking at the code, backendid seems sufficient since that is the
lookup key.
regards, tom lane