Re: Exposing the stats snapshot timestamp to SQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Exposing the stats snapshot timestamp to SQL
Date
Msg-id 32461.1424401272@sss.pgh.pa.us
Whole thread Raw
In response to Re: Exposing the stats snapshot timestamp to SQL  (Matt Kelly <mkellycs@gmail.com>)
List pgsql-hackers
Matt Kelly <mkellycs@gmail.com> writes:
>> Yeah.  The only use-case that's been suggested is detecting an
>> unresponsive stats collector, and the main timestamp should be plenty for
>> that.

> The problem with doing highly granular snapshots is that the postgres
> counters are monotonically increasing, but only when stats are published.
> Currently you have no option except to divide by the delta of now() between
> the polling intervals. If you poll every 2 seconds the max error is about
> .5/2 or 25%.  It makes reading those numbers a bit noisy.  Using
> (snapshot_timestamp_new
> - snapshot_timestamp_old) as the denominator in that calculation should
> help to smooth out that noise and show a clearer picture.

Ah, interesting!  Thanks for pointing out another use case.
        regards, tom lane



pgsql-hackers by date:

Previous
From: David Steele
Date:
Subject: Re: Allow "snapshot too old" error, to prevent bloat
Next
From: David Steele
Date:
Subject: Re: pgaudit - an auditing extension for PostgreSQL