Home > Net >  Delete query from pg_stat_statements in postgresql
Delete query from pg_stat_statements in postgresql

Time:06-06

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?

CodePudding user response:

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.

CodePudding user response:

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

  • Related