From: Mladen Gogala <mladen.gogala@vmsinfo.com>
To: Dimi Paun <dimi@lattica.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: What is postmaster doing?
Date: Wed, 20 Oct 2010 16:30:19 -0400
Message-ID: <4CBF515B.1060704@vmsinfo.com> (raw)
In-Reply-To: <1287600255.18151.58.camel@dimi.lattica.com>
References: <1287600255.18151.58.camel@dimi.lattica.com>
Dimi Paun wrote:
> Folks,
>
> I am running into a problem with the postmaster: from time to time, it
> runs for a long time. E.g., from top:
>
> 23425 postgres 20 0 22008 10m 10m R 99.9 0.5 21:45.87 postmaster
>
> I'd like to figure out what it is doing. How can I figure out what
> statement causes the problem?
>
> is there a way I can log all SQL statements to a file, together with the
> time it took to execute them?
>
>
You can do one better: you can even explain the statements, based on the
execution time. There is a module called auto explain:
http://www.postgresql.org/docs/8.4/static/auto-explain.html
For the log files, you can parse them using pgfouine and quickly find
out the most expensive SQL statements.
--
Mladen Gogala
Sr. Oracle DBA
1500 Broadway
New York, NY 10036
(212) 329-5251
http://www.vmsinfo.com
The Leader in Integrated Media Intelligence Solutions
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mladen.gogala@vmsinfo.com, dimi@lattica.com
Subject: Re: What is postmaster doing?
In-Reply-To: <4CBF515B.1060704@vmsinfo.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