Description:
I collect data from sys periodically and then truncate the tables via sys.ps_truncate_all_tables and currently there is no information on the time the tables are truncated.
So I have a local routine that records this timestamp in case I need to use it later.
How to repeat:
The performance_schema and sys views give you counters of things that have happened but in many cases there's no reference against _when_ this happened. If you don't have that reference the values are "partly" useless.
My current "simple" solution is to have such a table and my collection script populates it as needed.
me@some-host [sys]> select * from sys.truncation_time;
+----+---------------------+
| id | last_update |
+----+---------------------+
| 1 | 2015-10-09 10:05:06 |
+----+---------------------+
1 row in set (0.00 sec)
The id column can be ignored it's syntactic sugar which is not really necessary.
Suggested fix:
It would be useful if sys (or ideally performance_schema) had a way of allowing me to see when tables were truncated. Initially I'd just like to record a single time when sys.ps_truncate_all_tables was last called as that gives me a good approximation.
Longer term having this information available for each table in performance_schema would be better.