Reputation: 197
I know stats in performance schema are not persistent over MySQL restarts. I want to flush all stats without restarting MySQL. Is there any way to do it?
Thanks.
Upvotes: 12
Views: 9187
Reputation: 186
Easier then truncating each separate table would be to call the procedure:
CALL sys.ps_truncate_all_tables(FALSE);
Upvotes: 14
Reputation: 8395
TRUNCATE TABLE
can be used to reset statistics.
See https://dev.mysql.com/doc/refman/5.7/en/performance-schema-table-characteristics.html
Summary tables can be truncated with TRUNCATE TABLE. Generally, the effect is to reset the summary columns to 0 or NULL, not to remove rows. This enables you to clear collected values and restart aggregation.
Upvotes: 3