pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jim C. Nasby <jnasby@pervasive.com>
Cc: Dan Gorman <dgorman@hi5.com>
Cc: mischa@ca.sophos.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Selects query stats?
Date: Tue, 23 May 2006 15:13:13 -0400
Message-ID: <17713.1148411593@sss.pgh.pa.us> (raw)
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>

"Jim C. Nasby" <jnasby@pervasive.com> 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



view thread (19+ messages)  latest in thread

Message-ID: <17713.1148411593@sss.pgh.pa.us>
Permalink:  ../17713.1148411593@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/17713.1148411593@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, jnasby@pervasive.com, dgorman@hi5.com, mischa@ca.sophos.com
  Subject: Re: Selects query stats?
  In-Reply-To: <17713.1148411593@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox