2

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 2

6

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.

Sign up to request clarification or add additional context in comments.

3 Comments

But thats is not in version 11?
@yuoggy: check the extension
Thanks @FrankHeikens worked a charm 👌
-2

There are no options to delete statistics for a specific object.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.