Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYsLV-0005W2-Pm for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 14:26:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jYsLU-00057C-Kg for pgsql-hackers@arkaria.postgresql.org; Wed, 13 May 2020 14:26:52 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYsLU-000575-Dv for pgsql-hackers@lists.postgresql.org; Wed, 13 May 2020 14:26:52 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jYsLQ-00071r-Vn for pgsql-hackers@postgresql.org; Wed, 13 May 2020 14:26:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 04DEQdLR032136; Wed, 13 May 2020 10:26:40 -0400 From: Tom Lane To: Fujii Masao cc: Tomas Vondra , Alvaro Herrera , Masahiko Sawada , "tsunakawa.takay@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: SLRU statistics In-reply-to: References: <20200402004136.wodwftan45mcwggm@development> <20200430181901.24tlriahmafi4sfn@development> <0e1c8904-13be-ab70-0096-54f0b30e43ba@oss.nttdata.com> <20200502000818.nn4kpewiput42bnb@development> <49b8ad17-f6d9-a086-a952-ff1fec3ac1b3@oss.nttdata.com> <20200502105500.hwhba3d6s3hlrqf6@development> <20200502165905.brfxv6dk5vjdbgti@development> <976bbb73-a112-de3c-c488-b34b64609793@oss.nttdata.com> <20200513082159.myflgcs5fnhnujbk@development> Comments: In-reply-to Fujii Masao message dated "Wed, 13 May 2020 22:22:12 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32134.1589379999.1@sss.pgh.pa.us> Date: Wed, 13 May 2020 10:26:39 -0400 Message-ID: <32135.1589379999@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Fujii Masao writes: > On 2020/05/13 17:21, Tomas Vondra wrote: >> On Wed, May 13, 2020 at 04:10:30PM +0900, Fujii Masao wrote: >>> Also I found another minor issue; SLRUStats has not been initialized to 0 >>> and which could update the counters unexpectedly. Attached patch fixes >>> this issue. > Pushed both. Thanks! Why is that necessary? A static variable is defined by C to start off as zeroes. regards, tom lane