Re: What is postmaster doing?

From: Mladen Gogala <mladen(dot)gogala(at)vmsinfo(dot)com>
To: Dimi Paun <dimi(at)lattica(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: What is postmaster doing?
Date: 2010-10-20 20:30:19
Message-ID: 4CBF515B.1060704@vmsinfo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Dimi Paun 2010-10-20 20:39:33 Re: What is postmaster doing?
Previous Message Tom Lane 2010-10-20 20:26:14 Re: What is postmaster doing?