Re: get a log of queries that take up a lot of CPU or take a very long time.

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: get a log of queries that take up a lot of CPU or take a very long time.
Date: 2009-11-23 22:42:39
Message-ID: 200911231442.39230@hal.medialogik.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Monday 23 November 2009, Tim Uckun <timuckun(at)gmail(dot)com> wrote:
> Is there a way I can get a list of the top 10 longest running queries
> for the day/week/month or the top 10 queries that took the most CPU?
>
> select * from pg_stat_activity only shows the current status.

You can enable query logging, store the logs, and parse them.

--
"No animals were harmed in the recording of this episode. We tried but that
damn monkey was just too fast."

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Bailey 2009-11-23 22:49:31 Re: I need help creating a composite type with some sort of constraints.
Previous Message Tim Uckun 2009-11-23 22:41:00 get a log of queries that take up a lot of CPU or take a very long time.