Re: [HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-16 Thread Greg Smith
On 4/13/13 12:44 PM, Tomas Vondra wrote: I'm currently struggling with (quite uncommon) deployments where databases are created/dropped regularly (not to mention tables and indexes), and it's surprisingly difficult to process such stats to get reasonable values. Yes, it's a pain. If you aggreg

Re: [HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-14 Thread Robert Haas
On Sat, Apr 13, 2013 at 9:01 AM, Peter Eisentraut wrote: > On Sat, 2013-04-06 at 21:51 +0200, Tomas Vondra wrote: >> This more or less works in stable environments, but once you start >> dropping databases (think of hosting with shared DB server) it gets >> unusable because after DROP DATABASE the

Re: [HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-13 Thread Alvaro Herrera
Tomas Vondra wrote: > On 13.4.2013 15:01, Peter Eisentraut wrote: > > long-term analysis? Maybe you could even use event triggers to have > > DROP DATABASE do that automatically. > > I don't think event triggers are a good solution, although I'm wondering > how that's supposed to work. It doesn

Re: [HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-13 Thread Tomas Vondra
On 13.4.2013 15:01, Peter Eisentraut wrote: > On Sat, 2013-04-06 at 21:51 +0200, Tomas Vondra wrote: >> This more or less works in stable environments, but once you start >> dropping databases (think of hosting with shared DB server) it gets >> unusable because after DROP DATABASE the database sudd

Re: [HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-13 Thread Peter Eisentraut
On Sat, 2013-04-06 at 21:51 +0200, Tomas Vondra wrote: > This more or less works in stable environments, but once you start > dropping databases (think of hosting with shared DB server) it gets > unusable because after DROP DATABASE the database suddenly disappears > from the sum. > > Therefore I

Re: [HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-07 Thread Tomas Vondra
On 6.4.2013 21:51, Tomas Vondra wrote: > Hi, > > I'm regularly using pg_stat_database view to analyze various aspects of > behavior of the cluster. The #1 issue I'm constantly running into is > that to get cluster-level view (across all the databases), the table > needs to be aggregated like this:

[HACKERS] PROPOSAL: tracking aggregated numbers from pg_stat_database

2013-04-06 Thread Tomas Vondra
Hi, I'm regularly using pg_stat_database view to analyze various aspects of behavior of the cluster. The #1 issue I'm constantly running into is that to get cluster-level view (across all the databases), the table needs to be aggregated like this: SELECT SUM(blks_hit) blks_hit,