码迷,mamicode.com
首页 > 数据库 > 详细

mysql 表日常变化前几

时间:2015-12-21 12:29:35      阅读:138      评论:0      收藏:0      [点我收藏+]

标签:


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;

mysql 表日常变化前几

标签:

原文地址:http://www.cnblogs.com/hllnj2008/p/5062783.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!