Re: Shared buffers increased but cache hit ratio is still 85%

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
To: Andreas Kretschmer <andreas(at)a-kretschmer(dot)de>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Shared buffers increased but cache hit ratio is still 85%
Date: 2018-07-18 20:08:09
Message-ID: 732ab5cf-62bf-a2d0-bd3b-3f1f7db2c7ca@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Frost 2018-07-18 21:49:03 Re: User documentation vs Official Docs
Previous Message Sherrylyn Branchaw 2018-07-18 17:27:48 Re: Slow WAL recovery for DROP TABLE