I need to use pg_stat_statements, I have read about pg_stat_statements_reset() which can discards all statistics. But is there a function which can discards statisctic of one custom query? Can it be removed automatically?
Asked
Active
Viewed 684 times
2 Answers
4
Yes, that's possible, just reset the stats for this specific userid, database and query id:
SELECT pg_stat_statements_reset(userid Oid, dbid Oid, queryid bigint);
Check your stats for the right userid, dbid and queryid.

Frank Heikens
- 117,544
- 24
- 142
- 135
-
But thats is not in version 11? – yuoggy Jun 07 '22 at 09:13
-
@yuoggy: check the extension – Frank Heikens Jun 07 '22 at 17:01
-
Thanks @FrankHeikens worked a charm – John_Mason27 Jul 31 '23 at 12:06