I queried pg_stat_activity a bunch of times and was able to tell what tables
were being queried. I finally honed in on the section of code causing the
problem and fix it and all is good on the server now - over 90% idle.
I think the reason some of the processes were showing high CPU usage was
th
The following query with the stats_command_string parameter turned on will
give you some of the SQL per transaction:-
SELECT
datid,
datname as "DB Name",
substr(procpid,1,6) as "Procpid",
substr(usesysid,1,5) as "UseSysid",
usename,
current_query as "SQL",
query_start
FROM
pg_stat_activity
order
cerely,
--
Husam
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Aaron Bono
Sent: Wednesday, November 22, 2006 1:14 PM
To: Tomeh, Husam
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
D] On Behalf Of
Aaron Bono
Sent: Wednesday, November 22, 2006 1:46 PM
To: Tomeh, Husam
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
This indicates that some stats parameters are not enabled in
h, Husam
*Cc:* pgsql-admin@postgresql.org
*Subject:* Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
>
> You may query the system view, pg_stat_activity to check out the
> current SQL statements running. To track down executed SQL state
I check these tables.
--
*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Aaron
Bono
*Sent:* Wednesday, November 22, 2006 1:46 PM
*To:* Tomeh, Husam
*Cc:* pgsql-admin@postgresql.org
*Subject:* Re: [ADMIN] Monitoring PostgreSQL Process
On 11/22/06, Tomeh, Husam <
On 11/22/06, Tomeh, Husam <[EMAIL PROTECTED]> wrote:
You may query the system view, pg_stat_activity to check out the current
SQL statements running. To track down executed SQL statements into a
physical log file, you may want to enable statement logging. For more
details on that, check out:
ht
You may query the system view, pg_stat_activity to check out the current
SQL statements running. To track down executed SQL statements into a
physical log file, you may want to enable statement logging. For more
details on that, check out:
http://www.postgresql.org/docs/8.1/static/runtime-config-lo