From: Magnus Hagander on
On Wed, Mar 17, 2010 at 21:42, Bruce Momjian <bruce(a)momjian.us> wrote:
> Has anyone ever noticed that the order of pg_stat_activity timestamp
> columns is illogical:
>
>  xact_start       | timestamp with time zone |
>  query_start      | timestamp with time zone |
>  backend_start    | timestamp with time zone |

Well, 7.4 had only "query start". 8.1 added backend. 8.3 added
transaction. So I guess my original guess that things were just added
on the end was wrong :-)


> query_start is always between the other two timestamps.  Moving
> query_start before xact_start would make the most sense.  I wouldn't
> bring this up except we just added application_name before these
> columns, so we are already going to have different column locations for
> these fields in 9.0.
>
> Should we move query_start?

Or perhaps we should consider moving application_name to the end so it
*doesn't* break them?

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Bruce Momjian on
Magnus Hagander wrote:
> On Wed, Mar 17, 2010 at 21:42, Bruce Momjian <bruce(a)momjian.us> wrote:
> > Has anyone ever noticed that the order of pg_stat_activity timestamp
> > columns is illogical:
> >
> > ?xact_start ? ? ? | timestamp with time zone |
> > ?query_start ? ? ?| timestamp with time zone |
> > ?backend_start ? ?| timestamp with time zone |
>
> Well, 7.4 had only "query start". 8.1 added backend. 8.3 added
> transaction. So I guess my original guess that things were just added
> on the end was wrong :-)
>
>
> > query_start is always between the other two timestamps. ?Moving
> > query_start before xact_start would make the most sense. ?I wouldn't
> > bring this up except we just added application_name before these
> > columns, so we are already going to have different column locations for
> > these fields in 9.0.
> >
> > Should we move query_start?
>
> Or perhaps we should consider moving application_name to the end so it
> *doesn't* break them?

That's a possibility, but we obviously have been adding columns
out-of-order for several releases now and no one has complained.

--
Bruce Momjian <bruce(a)momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
Bruce Momjian <bruce(a)momjian.us> writes:
> That's a possibility, but we obviously have been adding columns
> out-of-order for several releases now and no one has complained.

On balance I'm for rationalizing this. The query_start time is
logically associated with current_query and waiting, so it ought
to be next to them. Without the historical fact that we've mucked
with the column ordering before, I might've voted differently.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: "Kevin Grittner" on
Bruce Momjian <bruce(a)momjian.us> wrote:

> xact_start | timestamp with time zone |
> query_start | timestamp with time zone |
> backend_start | timestamp with time zone |

> Should we move query_start?

It would scan better, to my mind, if we moved backend_start ahead of
xact_start.

And paint it red.

-Kevin

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Bruce Momjian on
Kevin Grittner wrote:
> Bruce Momjian <bruce(a)momjian.us> wrote:
>
> > xact_start | timestamp with time zone |
> > query_start | timestamp with time zone |
> > backend_start | timestamp with time zone |
>
> > Should we move query_start?
>
> It would scan better, to my mind, if we moved backend_start ahead of
> xact_start.

Yes, that is another idea that would work, though Tom's idea that the
query start should be near the query makes sense.

--
Bruce Momjian <bruce(a)momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers