pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Guillaume Smet <guillaume.smet@gmail.com>
To: Dan Gorman <dgorman@hi5.com>
Cc: mischa@ca.sophos.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Selects query stats?
Date: Tue, 23 May 2006 22:04:36 +0200
Message-ID: <1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com> (raw)
In-Reply-To: <82252882-2A15-4823-A517-7AB3161889D1@hi5.com>
References: <9C4E40CF-6C06-4297-AF32-A7EF2A3F3C0F@hi5.com>
	<4473512E.7020805@ca.sophos.com>
	<82252882-2A15-4823-A517-7AB3161889D1@hi5.com>

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



view thread (19+ messages)  latest in thread

Message-ID: <1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com>
Permalink:  ../1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com/
Also on:    postgresql.org/message-id/1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: guillaume.smet@gmail.com, dgorman@hi5.com, mischa@ca.sophos.com
  Subject: Re: Selects query stats?
  In-Reply-To: <1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com>
  References: <9C4E40CF-6C06-4297-AF32-A7EF2A3F3C0F@hi5.com> <4473512E.7020805@ca.sophos.com> <82252882-2A15-4823-A517-7AB3161889D1@hi5.com> <1d4e0c10605231304k5d3005fdla5f596e5194578e3@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox