From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Andreas Kretschmer <andreas@a-kretschmer.de>
To: pgsql-general@lists.postgresql.org
Subject: Re: Shared buffers increased but cache hit ratio is still 85%
Date: Wed, 18 Jul 2018 22:08:09 +0200
Message-ID: <732ab5cf-62bf-a2d0-bd3b-3f1f7db2c7ca@2ndquadrant.com> (raw)
In-Reply-To: <6ac7183c-d93b-9fc5-d7a7-8d2f312be0c0@a-kretschmer.de>
References: <CAApBw37fKf42KjQbt3cQfj7V4gx7LPAdLOMsLCRP__2TRRhvVg@mail.gmail.com>
<6ac7183c-d93b-9fc5-d7a7-8d2f312be0c0@a-kretschmer.de>
On 07/18/2018 10:43 AM, Andreas Kretschmer wrote:
>
>
> Am 18.07.2018 um 10:26 schrieb Hans Schou:
>> Am I doing something wrong or should some history be cleared?
>
> Reset the stats for that database. You can check the date of last reset
> with:
>
> select stats_reset from pg_stat_database where datname = 'database_name';
>
> and reset it with:
>
> ||pg_stat_reset()
> ||
> ||Reset all statistics counters for the current database to zero
> (requires superuser privileges by default, but EXECUTE for this function
> can be granted to others.)||
>
It might be better to note current values of the counters somewhere, and
compute a delta later (and use that to compute the cache hit ratio). The
issue is that pg_stat_reset() throws away all sorts of interesting and
important stats, including those driving autovacuum/autoanalyze.
regards
--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: tomas.vondra@2ndquadrant.com, andreas@a-kretschmer.de
Subject: Re: Shared buffers increased but cache hit ratio is still 85%
In-Reply-To: <732ab5cf-62bf-a2d0-bd3b-3f1f7db2c7ca@2ndquadrant.com>
References: <CAApBw37fKf42KjQbt3cQfj7V4gx7LPAdLOMsLCRP__2TRRhvVg@mail.gmail.com> <6ac7183c-d93b-9fc5-d7a7-8d2f312be0c0@a-kretschmer.de> <732ab5cf-62bf-a2d0-bd3b-3f1f7db2c7ca@2ndquadrant.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox