Re: Better Connection Statistics

From: Glyn Astill <glynastill(at)yahoo(dot)co(dot)uk>
To: Shaun Thomas <sthomas(at)optionshouse(dot)com>, 'bricklen' <bricklen(at)gmail(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Better Connection Statistics
Date: 2014-02-10 11:40:56
Message-ID: 1392032456.56889.YahooMailNeo@web133204.mail.ir2.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-novice

> From: Shaun Thomas <sthomas(at)optionshouse(dot)com>
>To: 'bricklen' <bricklen(at)gmail(dot)com>
>Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
>Sent: Friday, 7 February 2014, 22:36
>Subject: Re: [GENERAL] Better Connection Statistics
>
>
>> I don't know any tools off-hand, but you might be able to generate
>> partial statistics from the log files with a descriptive log_line_prefix
>> like "%m [%p] (user=%u) (db=%d) (rhost=%h) [vxid:%v txid:%x] [%i] "
>
>We get 60k queries per second all day long. No way am I turning on query logging to capture the stats I want. :)
>
>Last month, I needed to track something down and set log_min_duration_statement to 0, logging everything each connection does. It was only like that for 10 seconds, and I ended up with about 400MB of log output. I shudder to think of what would happen if I left it that way.
>

We have a similar issue here, I tend to set log_min_diration statement = 0 just for the user I want to know about and then run the logs through pg_badger.  Agreed that a more granular pg_stat_database would be awesome.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message James Sewell 2014-02-10 13:29:01 Re: WAL archive on slave
Previous Message Albe Laurenz 2014-02-10 09:30:36 Re: WAL archive on slave

Browse pgsql-novice by date

  From Date Subject
Next Message Carol Walter 2014-02-11 17:13:53 Copying data from a tab delimited file into a table
Previous Message Michael Paquier 2014-02-10 02:52:02 Re: Better Connection Statistics