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.
Easier then truncating each separate table would be to call the procedure:
CALL sys.ps_truncate_all_tables(FALSE);
MySQL 5.7 Reference Manual
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With