Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tl2ss-0002Dh-Gg for pgsql-admin@arkaria.postgresql.org; Tue, 18 Dec 2012 19:31:22 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tl2sr-0004ES-Bs for pgsql-admin@arkaria.postgresql.org; Tue, 18 Dec 2012 19:31:21 +0000 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1Tl2sq-0004EN-I2 for pgsql-admin@postgresql.org; Tue, 18 Dec 2012 19:31:20 +0000 Received: from mailout-us.gmx.com ([74.208.5.67]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1Tl2sn-0007Aa-DN for pgsql-admin@postgresql.org; Tue, 18 Dec 2012 19:31:19 +0000 Received: (qmail 7158 invoked by uid 0); 18 Dec 2012 19:24:36 -0000 Received: from 76.255.19.161 by rms-us012 with HTTP Cc: pgsql-admin@postgresql.org Content-Type: text/plain; charset="utf-8" Date: Tue, 18 Dec 2012 14:24:33 -0500 From: "Kevin Grittner" Message-ID: <20121218192433.14710@gmx.com> MIME-Version: 1.0 Subject: Re: PostgreSQL Performance Tuning / Postgresql.conf and on OS Level To: "Shams Khan" X-Authenticated: #138763884 X-Flags: 0001 X-Mailer: GMX.com Web Mailer x-registered: 0 Content-Transfer-Encoding: 8bit X-GMX-UID: pqeicNtk3zOlOQ09Lnwh2ed+IGRvb8A1 X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org Shams Khan wrote: > select now()-query_start as runtime,client_addr,pid,query from > pg_stat_activity where not query like '%IDLE%' order by 1; > When I check Idle session running question, shows the many queries running > but end of the query it shows Rollback and commit which take lot of time. No, you need to adjust that query. Add the state column and maybe the xact_start column to your output, and it should then be obvious how to modify your where clause. People felt it would be useful to see what the last statement was which had been run on a connection which was idle or (especially) idle in transaction. The query column no longer shows anything other than a query. -Kevin -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin