Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdbb239d

Browse files
committed
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 neverbecame nonzero for an SP-GiST index, although the related per-tuplecounters worked fine.This fix works a bit differently from other index AMs, in that thecounter increment occurs in spgrescan not spggettuple/spggetbitmap.It looks like this won't make the user-visible semantics noticeablydifferent, 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 thesame places.Per bug #17163 from Christian Quest. Back-patch to all supportedversions.Discussion:https://postgr.es/m/17163-b8c5cc88322a5e92@postgresql.org
1 parent53597fd commitdbb239d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

‎src/backend/access/spgist/spgscan.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include"access/relscan.h"
2020
#include"access/spgist_private.h"
2121
#include"miscadmin.h"
22+
#include"pgstat.h"
2223
#include"storage/bufmgr.h"
2324
#include"utils/datum.h"
2425
#include"utils/float.h"
@@ -405,6 +406,9 @@ spgrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys,
405406

406407
/* set up starting queue entries */
407408
resetSpGistScanOpaque(so);
409+
410+
/* count an indexscan for stats */
411+
pgstat_count_index_scan(scan->indexRelation);
408412
}
409413

410414
void

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp