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 7F4159FA279 for ; Tue, 23 May 2006 16:13:36 -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 29453-10 for ; Tue, 23 May 2006 16:13:22 -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 092F99FA169 for ; Tue, 23 May 2006 16:13:21 -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 k4NJDDUf017714; Tue, 23 May 2006 15:13:13 -0400 (EDT) To: "Jim C. Nasby" cc: Dan Gorman , mischa@ca.sophos.com, pgsql-performance@postgresql.org Subject: Re: Selects query stats? In-reply-to: <20060523184100.GW64371@pervasive.com> 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> Comments: In-reply-to "Jim C. Nasby" message dated "Tue, 23 May 2006 13:41:00 -0500" Date: Tue, 23 May 2006 15:13:13 -0400 Message-ID: <17713.1148411593@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/437 X-Sequence-Number: 19224 "Jim C. Nasby" writes: > On Tue, May 23, 2006 at 11:33:12AM -0700, Dan Gorman wrote: >> In any other DB (oracle, mysql) I know how many queries (selects) per >> second the database is executing. How do I get this >> number out of postgres? > You can't. You also can't know how many DML statements were executed > (though you can see how many tuples were inserted/updated/deleted), or > how many transactions have occured (well, you can hack the last one, but > it's a bit of a mess). Hack? We do count commits and rollbacks (see pg_stat_database); doesn't seem that hacky to me. Counting individual statements would add overhead (which the OP already declared unacceptable) and there are some definitional issues too, like whether to count statements executed within functions. regards, tom lane