Re: Selects query stats? - Mailing list pgsql-performance

From Guillaume Smet
Subject Re: Selects query stats?
Date
Msg-id 1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com
Whole thread Raw
In response to Re: Selects query stats?  (Dan Gorman <dgorman@hi5.com>)
List pgsql-performance
On 5/23/06, Dan Gorman <dgorman@hi5.com> 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

pgsql-performance by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Selects query stats?
Next
From: Simon Riggs
Date:
Subject: Re: Selects query stats?