aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2025-01-31 12:27:19 +0900
committerMichael Paquier <michael@paquier.xyz>2025-01-31 12:27:19 +0900
commitce5c620fb6252dca00d3856d5f09d56c7f1215d0 (patch)
treec1a9b8164a1398b2f5a5fba8150898aa1bd5ccfa /src/include
parent1e380fa7d82df8a1730b80a911f50952c711f2a8 (diff)
downloadpostgresql-ce5c620fb6252dca00d3856d5f09d56c7f1215d0.tar.gz
postgresql-ce5c620fb6252dca00d3856d5f09d56c7f1215d0.zip
Add pgstat_drop_matching_entries() to pgstats
This allows users of the cumulative statistics to drop entries in the shared hash stats table, deleting as well local references. Callers of this function can optionally define a callback able to filter which entries to drop, similarly to pgstat_reset_matching_entries() with its callback do_reset(). pgstat_drop_all_entries() is refactored so as it uses this new function. Author: Lukas Fitti Discussion: https://postgr.es/m/CAP53PkwuFbo3NkwZgxwNRMjMfqPEqidD-SggaoQ4ijotBVLJAA@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/utils/pgstat_internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/utils/pgstat_internal.h b/src/include/utils/pgstat_internal.h
index a3d39d2b725..06dcea3f0dc 100644
--- a/src/include/utils/pgstat_internal.h
+++ b/src/include/utils/pgstat_internal.h
@@ -718,6 +718,8 @@ extern bool pgstat_lock_entry_shared(PgStat_EntryRef *entry_ref, bool nowait);
extern void pgstat_unlock_entry(PgStat_EntryRef *entry_ref);
extern bool pgstat_drop_entry(PgStat_Kind kind, Oid dboid, uint64 objid);
extern void pgstat_drop_all_entries(void);
+extern void pgstat_drop_matching_entries(bool (*do_drop) (PgStatShared_HashEntry *, Datum),
+ Datum match_data);
extern PgStat_EntryRef *pgstat_get_entry_ref_locked(PgStat_Kind kind, Oid dboid, uint64 objid,
bool nowait);
extern void pgstat_reset_entry(PgStat_Kind kind, Oid dboid, uint64 objid, TimestampTz ts);