From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
Cc: | Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, daveg <daveg(at)sonic(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, decibel <decibel(at)decibel(dot)org>, Greg Stark <stark(at)enterprisedb(dot)com>, Asko Oja <ascoja(at)gmail(dot)com>, Tatsuhito Kasahara <kasahara(dot)tatsuhito(at)oss(dot)ntt(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: display previous query string of idle-in-transaction |
Date: | 2009-07-24 16:53:25 |
Message-ID: | 603c8f070907240953i5be5557ah815b2f62dfb55c12@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Fri, Jul 24, 2009 at 11:15 AM, Tom Lane<tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Hmm, I don't think we'd need two columns for this, actually. You
>> could just have one column last_statement_endtime (not sure if it's
>> the best name, but something along those lines) which would be NULL if
>> the statement was still in progress and the appropriate timestamp if
>> not. You could infer idle from whether or not that column was NULL.
>
> Yeah, but "where idle" or "where not idle" is a lot easier to type.
> I think the extra column is justified on usability grounds. I'm also
> not entirely convinced that we want last_statement_endtime, because
> introducing that will cost us an extra kernel call per query in a lot of
> scenarios. And gettimeofday() is not cheap everywhere.
I hate redundancy, but I don't care enough to argue about it.
> Another question is that this proposal effectively redefines the
> current_query column as not the "current" query, but something that
> might be better be described as "latest_query". Should we change the
> name? We'd probably break some client code if we did, but on the other
> hand the semantics change might break such code anyway. Intentional
> breakage might not be such a bad thing if it forces people to take a
> fresh look at their code.
+1 for intentional breakage. I like the name, too.
...Robert
From | Date | Subject | |
---|---|---|---|
Next Message | Sam Mason | 2009-07-24 16:56:14 | Re: When is a record NULL? |
Previous Message | Emanuel Calvo Franco | 2009-07-24 16:47:01 | uuid contrib don't compile in OpenSolaris |