Re: BUG #17163: spgist index scan statistics stays at 0

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: github(at)cquest(dot)org
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17163: spgist index scan statistics stays at 0
Date: 2021-08-27 22:48:46
Message-ID: 901541.1630104526@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alexander Lakhin 2021-08-28 16:59:08 Re: BUG #17161: Assert failed on opening a relation that exists in two schemas via the LANGUAGE SQL function
Previous Message Tom Lane 2021-08-27 18:33:04 Re: BUG #17163: spgist index scan statistics stays at 0