X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 1C2999FA279 for ; Tue, 23 May 2006 16:56:11 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 38052-06 for ; Tue, 23 May 2006 16:56:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 0D8CA9FA169 for ; Tue, 23 May 2006 16:55:57 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k4NJtpVl019284; Tue, 23 May 2006 15:55:51 -0400 (EDT) To: Alvaro Herrera cc: "Jim C. Nasby" , Dan Gorman , mischa@ca.sophos.com, pgsql-performance@postgresql.org Subject: Re: Selects query stats? In-reply-to: <20060523195001.GH28863@surnet.cl> References: <9C4E40CF-6C06-4297-AF32-A7EF2A3F3C0F@hi5.com> <4473512E.7020805@ca.sophos.com> <82252882-2A15-4823-A517-7AB3161889D1@hi5.com> <4473553C.1010804@ca.sophos.com> <127D68F6-7620-4A62-8D1A-9B475E7571CD@hi5.com> <20060523184100.GW64371@pervasive.com> <17713.1148411593@sss.pgh.pa.us> <20060523195001.GH28863@surnet.cl> Comments: In-reply-to Alvaro Herrera message dated "Tue, 23 May 2006 15:50:01 -0400" Date: Tue, 23 May 2006 15:55:50 -0400 Message-ID: <19283.1148414150@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/439 X-Sequence-Number: 19226 Alvaro Herrera writes: > OTOH ISTM it would be easy to modify Postgres so as to count statements > in the stat collector, by turning pgstat_report_activity into a routine > that sent a count (presumably always 1) instead of the query string, and > then just add the count to a counter on receiving. You wouldn't have to change the backends at all, just modify the collector to count the number of report_activity messages received. Might have to play some games with ignoring "" messages, but otherwise simple (and simplistic...) regards, tom lane