Count contrib/bloom index scans in pgstat view.
authorPeter Geoghegan <[email protected]>
Wed, 13 Nov 2024 01:57:45 +0000 (20:57 -0500)
committerPeter Geoghegan <[email protected]>
Wed, 13 Nov 2024 01:57:45 +0000 (20:57 -0500)
Maintain the pg_stat_user_indexes.idx_scan pgstat counter during
contrib/Bloom index scans.

Oversight in commit 9ee014fc, which added the Bloom index contrib
module.

Author: Masahiro Ikeda <[email protected]>
Reviewed-By: Peter Geoghegan <[email protected]>
Discussion: https://postgr.es/m/c48839d881388ee401a01807c686004d@oss.nttdata.com
Back: 13- (all supported branches).

contrib/bloom/blscan.c

index bf455e579fe85b0eb8d463068dc41b558b098389..0c5fb725e89570baa0b08f92bedd03dc3a03ecb4 100644 (file)
@@ -15,6 +15,7 @@
 #include "access/relscan.h"
 #include "bloom.h"
 #include "miscadmin.h"
+#include "pgstat.h"
 #include "storage/bufmgr.h"
 
 /*
@@ -114,6 +115,7 @@ blgetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
     */
    bas = GetAccessStrategy(BAS_BULKREAD);
    npages = RelationGetNumberOfBlocks(scan->indexRelation);
+   pgstat_count_index_scan(scan->indexRelation);
 
    for (blkno = BLOOM_HEAD_BLKNO; blkno < npages; blkno++)
    {