Re: Order of pg_stat_activity timestamp columns

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Order of pg_stat_activity timestamp columns
Date: 2010-03-17 21:30:07
Message-ID: 26354.1268861407@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> It would scan better, to my mind, if we moved backend_start ahead of
> xact_start.

The current column ordering can be rationalized to some extent as

1. identity info (user id, db id, application name)
2. current query info
3. session info (backend start time, client addr/port)

Putting backend_start first doesn't fit at all with that view of the
grouping. xact_start is sort of a borderline case, although one
could imagine that it might someday grow some friends and become a
full-fledged "current transaction info" grouping. So I'd prefer to
see it in between the columns that are clearly #2 and those that are
clearly #3.

If you believe that argument, there is a case for moving procpid into
group #3. I'm more hesitant to mess with the columns that have "always
been there" than those that got added in more recent releases, though.
It's possible also that some people might consider procpid as an identity
(key) column, in which case it's okay where it is.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2010-03-17 21:31:25 Re: Getting to beta1
Previous Message Bruce Momjian 2010-03-17 21:24:29 Re: Order of pg_stat_activity timestamp columns