Re: SLRU statistics - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: SLRU statistics
Date
Msg-id 20200328002630.2nz5y3dvymqnvxtv@development
Whole thread Raw
In response to Re: SLRU statistics  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: SLRU statistics
List pgsql-hackers
Hi,

here is a bit improved version of the patch - I've been annoyed by how
the resetting works (per-entry timestamp, but resetting all entries) so
I've added a new function pg_stat_reset_slru() that allows resetting
either all entries or just one entry (identified by name). So

     SELECT pg_stat_reset_slru('clog');

resets just "clog" SLRU counters, while

     SELECT pg_stat_reset_slru(NULL);

resets all entries.

I've also done a bit of benchmarking, to see if this has measurable
impact (in which case it might deserve a new GUC), and I think it's not
measurable. I've used a tiny unlogged table (single row).

     CREATE UNLOGGED TABLE t (a int);
     INSERT INTO t VALUES (1);

and then short pgbench runs with a single client, updatint the row. I've
been unable to measure any regression, it's all well within 1% so noise.
But perhaps there's some other benchmark that I should do?


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment

pgsql-hackers by date:

Previous
From: Jeff Davis
Date:
Subject: Re: Make MemoryContextMemAllocated() more precise
Next
From: Amit Kapila
Date:
Subject: Re: error context for vacuum to include block number