Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D0FA89F9955 for ; Tue, 9 Oct 2007 12:09:15 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 60698-02-2 for ; Tue, 9 Oct 2007 12:09:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 879359F9844 for ; Tue, 9 Oct 2007 12:09:04 -0300 (ADT) thread-index: AcgKhlymV4tFZY2US4eJpK8d+9gaYg== Received: from [192.168.1.33] ([82.20.63.3]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Oct 2007 11:09:16 -0400 Message-ID: <470B994F.1040405@enterprisedb.com> Date: Tue, 09 Oct 2007 16:07:59 +0100 From: "Heikki Linnakangas" X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073 Content-class: urn:content-classes:message User-Agent: Icedove 1.5.0.12 (X11/20070730) Importance: normal MIME-Version: 1.0 To: "Campbell, Lance" Cc: Subject: Re: SQL Monitoring References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 09 Oct 2007 15:09:17.0078 (UTC) FILETIME=[5C513360:01C80A86] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/85 X-Sequence-Number: 27107 Campbell, Lance wrote: > I have noticed a slight spike in the amount of CPU usage in the last few > weeks. I am sure it has to do with a change or two that was made to > some queries. What is the best way to log the SQL that is being > executed? Take a look at statement_timeout and log_statement configuration variables. > I would prefer to limit the size of the log file to 2 G. Is > there a way to do this? log_rotation_size, together with an external tool to delete old log files. Or use log_truncate_on_rotation and log_rotation_age instead of log_rotation_size. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com