diff options
| author | Tom Lane | 2007-04-30 03:23:49 +0000 |
|---|---|---|
| committer | Tom Lane | 2007-04-30 03:23:49 +0000 |
| commit | 957d08c81f9cc277725c83b9381c5154b6318a5e (patch) | |
| tree | 1c665d6e63c2cb02156df44a3519d2a0bebcaea3 /src/include/utils | |
| parent | 57b82bf324285464783796e5614d5f9aadd0817f (diff) | |
Implement rate-limiting logic on how often backends will attempt to send
messages to the stats collector. This avoids the problem that enabling
stats_row_level for autovacuum has a significant overhead for short
read-only transactions, as noted by Arjen van der Meijden. We can avoid
an extra gettimeofday call by piggybacking on the one done for WAL-logging
xact commit or abort (although that doesn't help read-only transactions,
since they don't WAL-log anything).
In my proposal for this, I noted that we could change the WAL log entries
for commit/abort to record full TimestampTz precision, instead of only
time_t as at present. That's not done in this patch, but will be committed
separately.
Diffstat (limited to 'src/include/utils')
| -rw-r--r-- | src/include/utils/timestamp.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/utils/timestamp.h b/src/include/utils/timestamp.h index 0d31cc02940..594cd61e884 100644 --- a/src/include/utils/timestamp.h +++ b/src/include/utils/timestamp.h @@ -6,7 +6,7 @@ * Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.67 2007/02/16 03:39:45 momjian Exp $ + * $PostgreSQL: pgsql/src/include/utils/timestamp.h,v 1.68 2007/04/30 03:23:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -311,6 +311,9 @@ extern TimestampTz GetCurrentTimestamp(void); extern void TimestampDifference(TimestampTz start_time, TimestampTz stop_time, long *secs, int *microsecs); +extern bool TimestampDifferenceExceeds(TimestampTz start_time, + TimestampTz stop_time, + int msec); extern TimestampTz time_t_to_timestamptz(time_t tm); extern time_t timestamptz_to_time_t(TimestampTz t); |
