Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 1160664FD89 for ; Tue, 14 Oct 2008 07:14:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 97080-03 for ; Tue, 14 Oct 2008 07:14:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-2317.dedibox.fr (sd-2317.dedibox.fr [88.191.17.192]) by postgresql.org (Postfix) with ESMTP id 8325C64FD7D for ; Tue, 14 Oct 2008 07:14:42 -0300 (ADT) Received: from [192.168.10.64] (ASte-Genev-Bois-153-1-7-40.w83-112.abo.wanadoo.fr [83.112.69.40]) by sd-2317.dedibox.fr (Postfix) with ESMTP id 906151DF9; Tue, 14 Oct 2008 12:14:38 +0200 (CEST) Message-ID: <48F4710A.1030609@lelarge.info> Date: Tue, 14 Oct 2008 12:14:34 +0200 From: Guillaume Lelarge User-Agent: Thunderbird 2.0.0.17 (X11/20080925) MIME-Version: 1.0 To: "Martin A. Brooks" CC: pgsql-admin@postgresql.org Subject: Re: postgres seems to ignore log_min_duration_statement References: <48F46514.1070203@antibodymx.net> In-Reply-To: <48F46514.1070203@antibodymx.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.693 tagged_above=0 required=5 tests=RCVD_IN_NJABL_PROXY=1.693 X-Spam-Level: * X-Archive-Number: 200810/95 X-Sequence-Number: 30551 Martin A. Brooks a écrit : > Hi > > I want to have postgres log sql statements that take longer than 5 > seconds to execute. In postgresql.conf I have set > log_min_duration_statement as follows: > > root@martin-desktop:/etc/postgresql/8.3/main# grep log_min_duration > postgresql.conf > log_min_duration_statement = 5000 # -1 is disabled, 0 logs all > statements > > However, in the log files, I'm seeing entries for all SQL executed, not > just that taking 5000ms or more. For example: > > 2008-10-14 10:15:50 BST PID:20349 DB:vhdb LOG: statement: select * from > vendors; > 2008-10-14 10:15:50 BST PID:20349 DB:vhdb LOG: duration: 0.259 ms > 2008-10-14 10:15:50 BST PID:20349 DB:vhdb LOG: QUERY STATISTICS > 2008-10-14 10:15:50 BST PID:20349 DB:vhdb DETAIL: ! system usage stats: > ! 0.000281 elapsed 0.000000 user 0.000000 system sec > ! [0.004000 user 0.004000 sys total] > ! 0/0 [0/176] filesystem blocks in/out > ! 0/0 [0/923] page faults/reclaims, 0 [0] swaps > ! 0 [0] signals rcvd, 0/0 [0/0] messages rcvd/sent > ! 0/0 [8/0] voluntary/involuntary context switches > ! buffer usage stats: > ! Shared blocks: 0 read, 0 written, > buffer hit rate = 100.00% > ! Local blocks: 0 read, 0 written, > buffer hit rate = 0.00% > ! Direct blocks: 0 read, 0 written > This last log is enabled with the log_statement_stats parameter. Set it to off to disable it. -- Guillaume. http://www.postgresqlfr.org http://dalibo.com