mysql 表日常变化前几
use performance_schema
create table test.snap1 as SELECT OBJECT_SCHEMA, OBJECT_NAME, COUNT_STAR, SUM_TIMER_WAIT, COUNT_READ, SUM_TIMER_READ, COUNT_WRITE, SUM_TIMER_WRITE, COUNT_FETCH, SUM_TIMER_FETCH, COUNT_INSERT, SUM_TIMER_INSERT, COUNT_UPDATE, SUM_TIMER_UPDATE, COUNT_DELETE, SUM_TIMER_DELETE FROM table_io_waits_summary_by_table ;
create table test.snap2 as SELECT OBJECT_SCHEMA, OBJECT_NAME, COUNT_STAR, SUM_TIMER_WAIT, COUNT_READ, SUM_TIMER_READ, COUNT_WRITE, SUM_TIMER_WRITE, COUNT_FETCH, SUM_TIMER_FETCH, COUNT_INSERT, SUM_TIMER_INSERT, COUNT_UPDATE, SUM_TIMER_UPDATE, COUNT_DELETE, SUM_TIMER_DELETE FROM table_io_waits_summary_by_table ;
select a.OBJECT_NAME,a.COUNT_WRITE-b.COUNT_WRITE from test.snap1 b, test.snap2 a where a.OBJECT_SCHEMA=b.OBJECT_SCHEMA and a.OBJECT_NAME=b.OBJECT_NAME order by a.COUNT_WRITE-b.COUNT_WRITE desc;