Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffskF-0006kq-N7 for pgsql-general@arkaria.postgresql.org; Wed, 18 Jul 2018 20:08:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ffskE-0002Fu-4f for pgsql-general@arkaria.postgresql.org; Wed, 18 Jul 2018 20:08:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ffskD-0002Fh-T6 for pgsql-general@lists.postgresql.org; Wed, 18 Jul 2018 20:08:17 +0000 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ffskA-0008TP-3u for pgsql-general@lists.postgresql.org; Wed, 18 Jul 2018 20:08:17 +0000 Received: by mail-wm0-x241.google.com with SMTP id y22-v6so4108675wma.0 for ; Wed, 18 Jul 2018 13:08:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=9jl1PjA/sg6/UN4Db68PbP/xW72nuE6871MgIDrgCF0=; b=12+xs1eFRfCc5u2zRkXkUjXmEzoekLmvyhi/CaPoVFU6c/O/++Dvk22WswdhHv7Ko0 2wbzzBkjs6eu/tgsaNXQS8hFQNr/Dqkjn0nnimo8aa1K8EZ29qsRt9ot/d7cJICBiAUl rK3I8Wavcndm3EgWIng/nAmi/D6w3lkqfQCTTXS2THu6KEjwjUXQgdFxJB64QQWRHGDB 93JORDhcfg/Yqol7242PZ7QmvStPJoFYguY6WU+WVZHeG+AU1xJzBRVqhaNsXbM02YNp hCurCQIWGh94tHIgKyRUpgQ/Ombi1O0eYZohGHlA7AfVq/Ldc2Sl3mykc95efEWiN7Tw 5X/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=9jl1PjA/sg6/UN4Db68PbP/xW72nuE6871MgIDrgCF0=; b=arSgVsvllrZ0euEcgyw9CpC6Z9dfImGmJWWtDuPiCndyZ3/3JjsqoKEa0QHgJgkYNP jfCA+1G6Fcm6ATVaj2DFoguOCQ6U2KetT8T0Wi15a2nCw4PYTDJnjyJxkCLjzFHPtVcq K5cSu894U0yu+bHi0YhEj6h+R5q5OqukZJTd0eVdQoJv3z8kJpL+W8B6cf8ZShstzP1E p3xECGc+1lxdUTRRbN/yc1S+N7E9iGPGleAgfrZl9oQDqfodrgQKhm0bRNIcF599F2ij 29NzuKoTQ8ikF6QCsOSnsRPsGL3iQjj4PoUK4tsM2qGDbSSjwlB8MiPtfFCWuIwxqP2o rZxw== X-Gm-Message-State: AOUpUlEzmN0vLC6cbJSNv3IwFu1sWndT8RB8sa71y1Pv+ZceXqT7jBj/ 0+5qJVboW/RvrN5zrq5TsWK5PibMECVLQANd3sgG69MVAGwQwynv4puwAonzDA1Ksh6CBLiSgAA BJ/vnOJHI+YopdXMlqNwfN/4rod5fix9qQaW43wOwJM7o5hNid1Ga1CFMZWRx9yRw69SZ5YW7SH YV5QdVrQrL9ITo8Tzk X-Google-Smtp-Source: AAOMgpeeA3A9R2sGbHqnFM1bfUaflEOFB0GRfuwEMs5L5I1VOdSQOqYPWtvWwh4lTiBtTFJfjsXHEA== X-Received: by 2002:a1c:9cd3:: with SMTP id f202-v6mr2398751wme.148.1531944492619; Wed, 18 Jul 2018 13:08:12 -0700 (PDT) Received: from [10.137.2.19] (ip-78-102-97-226.net.upcbroadband.cz. [78.102.97.226]) by smtp.gmail.com with ESMTPSA id n14-v6sm2241787wmc.14.2018.07.18.13.08.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 13:08:11 -0700 (PDT) Subject: Re: Shared buffers increased but cache hit ratio is still 85% To: Andreas Kretschmer , pgsql-general@lists.postgresql.org References: <6ac7183c-d93b-9fc5-d7a7-8d2f312be0c0@a-kretschmer.de> From: Tomas Vondra Message-ID: <732ab5cf-62bf-a2d0-bd3b-3f1f7db2c7ca@2ndquadrant.com> Date: Wed, 18 Jul 2018 22:08:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <6ac7183c-d93b-9fc5-d7a7-8d2f312be0c0@a-kretschmer.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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