X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 2C0589FA279 for ; Tue, 23 May 2006 17:04:54 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 38028-10 for ; Tue, 23 May 2006 17:04:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.207]) by postgresql.org (Postfix) with ESMTP id 1067C9FA169 for ; Tue, 23 May 2006 17:04:38 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id 18so1398002nzp for ; Tue, 23 May 2006 13:04:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=KmymR25dAROY1Puf1xuHziyP67plh67aYRdyZnLIxsn2Zvk74N432t7dL4Vv+GSODpqGKLJrbwTHhgXH5ubaLoOOJ48+mxXlR2Pat0snIMQcX5rTFfa8t+Kd1zjLwjRsdqwqXK1bMZoTct0QLTSb938R2Eo6jI2vKW+5Q03TeCI= Received: by 10.64.152.2 with SMTP id z2mr2365360qbd; Tue, 23 May 2006 13:04:36 -0700 (PDT) Received: by 10.65.121.19 with HTTP; Tue, 23 May 2006 13:04:36 -0700 (PDT) Message-ID: <1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com> Date: Tue, 23 May 2006 22:04:36 +0200 From: "Guillaume Smet" To: "Dan Gorman" Subject: Re: Selects query stats? Cc: mischa@ca.sophos.com, pgsql-performance@postgresql.org In-Reply-To: <82252882-2A15-4823-A517-7AB3161889D1@hi5.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <9C4E40CF-6C06-4297-AF32-A7EF2A3F3C0F@hi5.com> <4473512E.7020805@ca.sophos.com> <82252882-2A15-4823-A517-7AB3161889D1@hi5.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/441 X-Sequence-Number: 19228 On 5/23/06, Dan Gorman wrote: > What I am looking for is that our DB is doing X selects a min. If you're using 7.4, you can use log_duration to only log duration. It won't log all the query text, only one short line per query. Then you can use pgFouine to analyze this and having a graph such like that http://pgfouine.projects.postgresql.org/reports/sample_hourly.html . If you only log duration, you won't be able to separate insert/delete/update from select though. So it can be interesting only if they negligible. Note that this is not possible in 8.x. You'll have to log the statement to log the duration. I proposed a patch but it was refused as it complexified the log configuration. > Turning on logging isn't an option as it will create too much IO in > our enviornment. What we do here is logging on another machine via the network using syslog. From our experience, it's not the fact to log that really slows down the db but the generated I/O load. So if you do that, you should be able to log the statements without slowing down your database too much. On our production databases, we keep the log running all the time and we generate reports daily. Regards, -- Guillaume