1

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?

yuoggy
  • 97
  • 1
  • 10

2 Answers2

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
-1

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

yuoggy
  • 97
  • 1
  • 10