pgsql: Count SP-GiST index scans in pg_stat statistics. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Count SP-GiST index scans in pg_stat statistics.
Date
Msg-id E1mJlf7-00088W-1v@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Count SP-GiST index scans in pg_stat statistics.

Somehow, spgist overlooked the need to call pgstat_count_index_scan().
Hence, pg_stat_all_indexes.idx_scan and equivalent columns never
became nonzero for an SP-GiST index, although the related per-tuple
counters worked fine.

This fix works a bit differently from other index AMs, in that the
counter increment occurs in spgrescan not spggettuple/spggetbitmap.
It looks like this won't make the user-visible semantics noticeably
different, so I won't go to the trouble of introducing an is-this-
the-first-call flag just to make the counter bumps happen in the
same places.

Per bug #17163 from Christian Quest.  Back-patch to all supported
versions.

Discussion: https://postgr.es/m/17163-b8c5cc88322a5e92@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6a787c83c48a4d87d5aaa57776015ab77934d0ce

Modified Files
--------------
src/backend/access/spgist/spgscan.c | 4 ++++
1 file changed, 4 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Count SP-GiST index scans in pg_stat statistics.
Next
From: Noah Misch
Date:
Subject: pgsql: Fix data loss in wal_level=minimal crash recovery of CREATE TABL