Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CF075475BC3; Mon, 23 Sep 2002 09:25:05 -0400 (EDT) Received: from metrony.com (webware.metrony.com [207.159.131.106]) by postgresql.org (Postfix) with ESMTP id 4FCC2475C60; Mon, 23 Sep 2002 09:25:03 -0400 (EDT) Received: from MetroNY.com ([66.9.109.130]) by metrony.com (8.11.0/8.11.0) with ESMTP id g8NDOiT99904; Mon, 23 Sep 2002 13:24:44 GMT (envelope-from aaron@MetroNY.com) Message-ID: <3D8F1616.3040509@MetroNY.com> Date: Mon, 23 Sep 2002 09:24:38 -0400 From: Aaron Held User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bruce Momjian Cc: Neil Conway , pgsql-sql@postgresql.org, pgsql-general@postgresql.org Subject: Re: Monitoring a Query References: <200209230151.g8N1ptW22413@candle.pha.pa.us> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200209/990 X-Sequence-Number: 30571 Bruce Momjian wrote: > Neil Conway wrote: > >>Bruce Momjian writes: >> >>>Aaron Held wrote: >>> >>>>Is there any way to monitor a long running query? >>> >>>Oh, sorry, you want to know how far the query has progressed. Gee, I >>>don't think there is any easy way to do that. >> >>Would it be a good idea to add the time that the current query began >>execution at to pg_stat_activity? > > > What do people think about this? It seems like a good idea to me. > My application marks the start time of each query and I have found it very useful. The users like to see how long each query took, and the admin can take a quick look and see how many queries are running and how long each has been active for. Good for debugging and billing. -Aaron Held