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?
2 Answers
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.
3 Comments
yuoggy
But thats is not in version 11?
Frank Heikens
@yuoggy: check the extension
jjnrmason
Thanks @FrankHeikens worked a charm 👌