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 1mJked-0002Zu-C4 for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Aug 2021 22:48:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mJkec-0007La-CE for pgsql-bugs@arkaria.postgresql.org; Fri, 27 Aug 2021 22:48:54 +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 1mJkec-0007LS-5z for pgsql-bugs@lists.postgresql.org; Fri, 27 Aug 2021 22:48:54 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mJkeZ-0005am-Qu for pgsql-bugs@lists.postgresql.org; Fri, 27 Aug 2021 22:48:53 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 17RMmkkS901542; Fri, 27 Aug 2021 18:48:46 -0400 From: Tom Lane To: github@cquest.org cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17163: spgist index scan statistics stays at 0 In-reply-to: <862973.1630089184@sss.pgh.pa.us> References: <17163-b8c5cc88322a5e92@postgresql.org> <862973.1630089184@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Fri, 27 Aug 2021 14:33:04 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <901540.1630104526.1@sss.pgh.pa.us> Date: Fri, 27 Aug 2021 18:48:46 -0400 Message-ID: <901541.1630104526@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > The other index AMs do that during the first amgettuple or amgetbitmap > call, but it doesn't look like there is any convenient way to duplicate > that behavior in spgist; none of the code in or below spggettuple or > spggetbitmap is explicitly aware of whether this is the first call. > I'm inclined to propose adding the counter bump in spgrescan. That > isn't *exactly* equivalent semantics, but it would only matter if > someplace called amrescan and then didn't follow through with a scan. > The attached seems to behave as I'd expect. I had a nagging feeling that we might have multiple amrescan calls in some code paths, but after reviewing the commit log, it looks like that stopped being an issue in 9.1 (commit d583f10b7). So it should be okay to do it like this in supported branches. regards, tom lane