Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 9908763434E for ; Mon, 30 Mar 2009 04:31:32 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 09970-04 for ; Mon, 30 Mar 2009 04:31:18 -0300 (ADT) X-Greylist: delayed 00:23:03.209234 by SQLgrey-1.7.6 Received: from serv2.oss.ntt.co.jp (serv2.oss.ntt.co.jp [222.151.198.100]) by mail.postgresql.org (Postfix) with ESMTP id 63D966342F1 for ; Mon, 30 Mar 2009 04:31:21 -0300 (ADT) Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 534B0248140; Mon, 30 Mar 2009 16:08:13 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.localdomain [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 3FC432480E1; Mon, 30 Mar 2009 16:08:13 +0900 (JST) Received: from [127.0.0.1] (unknown [172.17.1.145]) by serv1.oss.ntt.co.jp (Postfix) with ESMTP id 0BC93104165; Mon, 30 Mar 2009 16:08:13 +0900 (JST) Message-ID: <49D06FD7.7030906@oss.ntt.co.jp> Date: Mon, 30 Mar 2009 16:08:07 +0900 From: Tatsuhito Kasahara User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Guillaume Smet CC: Simon Riggs , pgsql-hackers@postgresql.org Subject: Re: display previous query string of idle-in-transaction References: <49C9F49B.8020003@oss.ntt.co.jp> <1238091273.16568.530.camel@ebony.2ndQuadrant> <49CC75E3.7010101@oss.ntt.co.jp> <1d4e0c10903270027k7e5ab5dduc9961f62ee89621d@mail.gmail.com> <1d4e0c10903270038s1785d37ai80b82e70f3287a24@mail.gmail.com> In-Reply-To: <1d4e0c10903270038s1785d37ai80b82e70f3287a24@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/1263 X-Sequence-Number: 135941 (Sorry for delay..) Guillaume Smet wrote: > Being able to detect which application is running which query on the > very same database with the very same user seems like something not so > obvious and the use case seems to be pretty narrow. And IMHO, even if > we suppose you can make the difference between the applications with > only one query, you won't be able to limit your investigation to this > application. Yes, I won't be able to *completely* detect which application is running long transaction with a last query. But, as I said, I can get a hint for guessing causes from it. And, as Simon said, I can detect a problem point with collaboration from other information (app's log, app's source, operation procedure, and so on). > So, in fact, I'm still not convinced. Could you detail a bit more how > you plan to use it? Well, Now, I can't get enough information from pg_stat_activity. So, I have to check huge logs or reproduce the same problem. (They are annoying works.) If I can check last and more queries, I can use it as a hint for narrowing down problem points with app's log and so on. # And search the point and fix (or suggesting action) it. I hope it would be able to narrowing down problem points more easily. Best regards, -- Tatsuhito Kasahara kasahara.tatsuhito@oss.ntt.co.jp