Thread
Commits
-
Count SP-GiST index scans in pg_stat statistics.
- e84d4810cd47 14.0 landed
- 3778bcb39a94 15.0 landed
- dbb239d518ee 13.5 landed
- 9e959f7ed5d5 9.6.24 landed
- 7c1b0f4c3535 11.14 landed
- 6a787c83c48a 10.19 landed
- 187b5fea982e 12.9 landed
-
Create core infrastructure for KNNGIST.
- d583f10b7e0b 9.1.0 cited
-
BUG #17163: spgist index scan statistics stays at 0
The Post Office <noreply@postgresql.org> — 2021-08-27T07:18:23Z
The following bug has been logged on the website: Bug reference: 17163 Logged by: Christian Quest Email address: github@cquest.org PostgreSQL version: 13.4 Operating system: Ubuntu 20.04 Description: The idx_scan in pg_stat_all_indexes stays at 0 for spgist index, while the idx_tup_read and idx_tup_fetch and correctly updated.
-
Re: BUG #17163: spgist index scan statistics stays at 0
Tom Lane <tgl@sss.pgh.pa.us> — 2021-08-27T18:33:04Z
PG Bug reporting form <noreply@postgresql.org> writes: > The idx_scan in pg_stat_all_indexes stays at 0 for spgist index, while the > idx_tup_read and idx_tup_fetch and correctly updated. Hmm, you're right, there's no pgstat_count_index_scan anywhere in access/spgist/ :-( 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. regards, tom lane
-
Re: BUG #17163: spgist index scan statistics stays at 0
Tom Lane <tgl@sss.pgh.pa.us> — 2021-08-27T22:48:46Z
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