Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 7460D2E0032 for ; Mon, 31 Mar 2008 09:19:43 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 55740-04 for ; Mon, 31 Mar 2008 09:19:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from lists.commandprompt.com (host-159.commandprompt.net [207.173.203.159]) by developer.postgresql.org (Postfix) with ESMTP id DBDE32E002E for ; Mon, 31 Mar 2008 09:19:40 -0300 (ADT) Received: from localhost (108-49-113-92.pool.ukrtel.net [92.113.49.108] (may be forged)) (authenticated bits=0) by lists.commandprompt.com (8.13.8/8.13.8) with ESMTP id m2VCK75c001487 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 31 Mar 2008 05:20:10 -0700 Date: Mon, 31 Mar 2008 15:19:34 +0300 From: Alexey Klyukin To: Vladimir Rusinov Cc: pgsql-admin@postgresql.org Subject: Re: log_min_duration_statement log parsing Message-ID: <20080331121934.GA7007@vollmond> Mail-Followup-To: Vladimir Rusinov , pgsql-admin@postgresql.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.15+20070412 (2007-04-11) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (lists.commandprompt.com [207.173.203.159]); Mon, 31 Mar 2008 05:20:11 -0700 (PDT) X-Archive-Number: 200803/276 X-Sequence-Number: 28759 Vladimir Rusinov wrote: > Hello! > > I need a daily list of log-running statements. I've turned on > log_min_duraion_statement and going to write script which would daily parse > postgresql log and mail it to me, but I have no long-running statements (and > don't wanna do specially) and I can't see any in my log file. How does they > look? Just set log_min_duration to 0, according to the manual it would print all statement duration so you can see how it looks on your system. > > And may be someone have such script or other ideas how to log long-running > statements in order to optimize them? I suggest you to take a look at pgFouine: http://pgfouine.projects.postgresql.org/ -- Alexey Klyukin http://www.commandprompt.com/ The PostgreSQL Company - Command Prompt, Inc.