Re: Configurable Additional Stats

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Dave Page" <dpage(at)postgresql(dot)org>, "Gregory Stark" <stark(at)enterprisedb(dot)com>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Configurable Additional Stats
Date: 2007-07-02 15:51:10
Message-ID: 1183391470.10968.26.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 2007-06-29 at 14:43 -0400, Tom Lane wrote:
> Dave Page <dpage(at)postgresql(dot)org> writes:
> > Yes, it's not intended to insert more stats, but to get the raw data out
> > for external analysis during development and testing of applications and
> > systems etc.
>
> Mph --- the proposal was very poorly titled then. In any case, it still
> sounds like a one-off hack that would be equally well served by a local
> patch.

Well, I want it to a) be configurable b) provide additional stats, so
the title was fine, but we can call this whatever you like; I don't have
a fancy name for it.

The purpose is to get access to the stats data while we still know the
username, transactionId and other information. Once it is sent to the
stats collector it is anonymised and summarised.

Examples of the potential uses of such plug-ins would be:

1) Which tables have been touched by this transaction? The purpose of
this is to profile table interactions to allow:
i) an accurate assessment of the replication sets for use with Slony. If
you define the replication set incorrectly then you may not be able to
recover all of your data.
ii) determining whether it is possible to split a database that serves
two applications into two distinct databases (or not), allowing you to
scale out the Data Tier in a Service Oriented Application.

2) Charge-back accounting. Keep track by userid, user group, time of
access etc of all accesses to the system, so we can provide chargeback
facilities to users. You can put your charging rules into the plugin and
have it spit out appropriate chargeback log records, when/if required.
e.g. log a chargeback record every time a transaction touches > 100
blocks, to keep track of heavy queries but ignore OLTP workloads.

3) Tracing individual transaction types, as Greg suggests.

4) Anything else you might dream up...

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2007-07-02 16:12:11 Re: what is difference between LOCAL and GLOBAL TEMP TABLES in PostgreSQL
Previous Message Gregory Stark 2007-07-02 15:17:20 Re: ANALYZE and index/stats degradation