pt-query-digest默认查询时间分布

  1. # Query_time distribution
  2. # 1us
  3. # 10us #############################################
  4. # 100us ################################################################
  5. # 1ms ##########
  6. # 10ms
  7. # 100ms
  8. # 1s
  9. # 10s+

超过1ms上时间,区间太大了,可以做如下改进

  1. # Query_time distribution
  2. # 1us 0
  3. # 10us ############################################# 31
  4. # 100us ################################################################ 44
  5. # 1ms ######## 6
  6. # 5ms # 1
  7. # 10ms 0
  8. # 20ms 0
  9. # 30ms 0
  10. # 50ms 0
  11. # 100ms 0
  12. # 200ms 0
  13. # 300ms 0
  14. # 500ms 0
  15. # 800ms 0
  16. # 1s 0
  17. # 10s+ 0

通过--review和--history命令,将分析的数据插入到数据中

  1. Table: query_history
  2. Create Table: CREATE TABLE `query_history` (
  3. `checksum` bigint(20) unsigned NOT NULL,
  4. `sample` text NOT NULL,
  5. `ts_min` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  6. `ts_max` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  7. `ts_cnt` float DEFAULT NULL,
  8. `Query_time_sum` float DEFAULT NULL,
  9. `Query_time_min` float DEFAULT NULL,
  10. `Query_time_max` float DEFAULT NULL,
  11. `Query_time_pct_95` float DEFAULT NULL,
  12. `Query_time_stddev` float DEFAULT NULL,
  13. `Query_time_median` float DEFAULT NULL,
  14. `Lock_time_sum` float DEFAULT NULL,
  15. `Lock_time_min` float DEFAULT NULL,
  16. `Lock_time_max` float DEFAULT NULL,
  17. `Lock_time_pct_95` float DEFAULT NULL,
  18. `Lock_time_stddev` float DEFAULT NULL,
  19. `Lock_time_median` float DEFAULT NULL,
  20. `Rows_sent_sum` float DEFAULT NULL,
  21. `Rows_sent_min` float DEFAULT NULL,
  22. `Rows_sent_max` float DEFAULT NULL,
  23. `Rows_sent_pct_95` float DEFAULT NULL,
  24. `Rows_sent_stddev` float DEFAULT NULL,
  25. `Rows_sent_median` float DEFAULT NULL,
  26. `Rows_examined_sum` float DEFAULT NULL,
  27. `Rows_examined_min` float DEFAULT NULL,
  28. `Rows_examined_max` float DEFAULT NULL,
  29. `Rows_examined_pct_95` float DEFAULT NULL,
  30. `Rows_examined_stddev` float DEFAULT NULL,
  31. `Rows_examined_median` float DEFAULT NULL,
  32. `Rows_affected_sum` float DEFAULT NULL,
  33. `Rows_affected_min` float DEFAULT NULL,
  34. `Rows_affected_max` float DEFAULT NULL,
  35. `Rows_affected_pct_95` float DEFAULT NULL,
  36. `Rows_affected_stddev` float DEFAULT NULL,
  37. `Rows_affected_median` float DEFAULT NULL,
  38. `Rows_read_sum` float DEFAULT NULL,
  39. `Rows_read_min` float DEFAULT NULL,
  40. `Rows_read_max` float DEFAULT NULL,
  41. `Rows_read_pct_95` float DEFAULT NULL,
  42. `Rows_read_stddev` float DEFAULT NULL,
  43. `Rows_read_median` float DEFAULT NULL,
  44. `Merge_passes_sum` float DEFAULT NULL,
  45. `Merge_passes_min` float DEFAULT NULL,
  46. `Merge_passes_max` float DEFAULT NULL,
  47. `Merge_passes_pct_95` float DEFAULT NULL,
  48. `Merge_passes_stddev` float DEFAULT NULL,
  49. `Merge_passes_median` float DEFAULT NULL,
  50. `InnoDB_IO_r_ops_min` float DEFAULT NULL,
  51. `InnoDB_IO_r_ops_max` float DEFAULT NULL,
  52. `InnoDB_IO_r_ops_pct_95` float DEFAULT NULL,
  53. `InnoDB_IO_r_ops_stddev` float DEFAULT NULL,
  54. `InnoDB_IO_r_ops_median` float DEFAULT NULL,
  55. `InnoDB_IO_r_bytes_min` float DEFAULT NULL,
  56. `InnoDB_IO_r_bytes_max` float DEFAULT NULL,
  57. `InnoDB_IO_r_bytes_pct_95` float DEFAULT NULL,
  58. `InnoDB_IO_r_bytes_stddev` float DEFAULT NULL,
  59. `InnoDB_IO_r_bytes_median` float DEFAULT NULL,
  60. `InnoDB_IO_r_wait_min` float DEFAULT NULL,
  61. `InnoDB_IO_r_wait_max` float DEFAULT NULL,
  62. `InnoDB_IO_r_wait_pct_95` float DEFAULT NULL,
  63. `InnoDB_IO_r_wait_stddev` float DEFAULT NULL,
  64. `InnoDB_IO_r_wait_median` float DEFAULT NULL,
  65. `InnoDB_rec_lock_wait_min` float DEFAULT NULL,
  66. `InnoDB_rec_lock_wait_max` float DEFAULT NULL,
  67. `InnoDB_rec_lock_wait_pct_95` float DEFAULT NULL,
  68. `InnoDB_rec_lock_wait_stddev` float DEFAULT NULL,
  69. `InnoDB_rec_lock_wait_median` float DEFAULT NULL,
  70. `InnoDB_queue_wait_min` float DEFAULT NULL,
  71. `InnoDB_queue_wait_max` float DEFAULT NULL,
  72. `InnoDB_queue_wait_pct_95` float DEFAULT NULL,
  73. `InnoDB_queue_wait_stddev` float DEFAULT NULL,
  74. `InnoDB_queue_wait_median` float DEFAULT NULL,
  75. `InnoDB_pages_distinct_min` float DEFAULT NULL,
  76. `InnoDB_pages_distinct_max` float DEFAULT NULL,
  77. `InnoDB_pages_distinct_pct_95` float DEFAULT NULL,
  78. `InnoDB_pages_distinct_stddev` float DEFAULT NULL,
  79. `InnoDB_pages_distinct_median` float DEFAULT NULL,
  80. `QC_Hit_cnt` float DEFAULT NULL,
  81. `QC_Hit_sum` float DEFAULT NULL,
  82. `Full_scan_cnt` float DEFAULT NULL,
  83. `Full_scan_sum` float DEFAULT NULL,
  84. `Full_join_cnt` float DEFAULT NULL,
  85. `Full_join_sum` float DEFAULT NULL,
  86. `Tmp_table_cnt` float DEFAULT NULL,
  87. `Tmp_table_sum` float DEFAULT NULL,
  88. `Tmp_table_on_disk_cnt` float DEFAULT NULL,
  89. `Tmp_table_on_disk_sum` float DEFAULT NULL,
  90. `Filesort_cnt` float DEFAULT NULL,
  91. `Filesort_sum` float DEFAULT NULL,
  92. `Filesort_on_disk_cnt` float DEFAULT NULL,
  93. `Filesort_on_disk_sum` float DEFAULT NULL,
  94. PRIMARY KEY (`checksum`,`ts_min`,`ts_max`)
  95. ) ENGINE=InnoDB DEFAULT CHARSET=latin1
  1. mysql> show create table query_review\G
  2. *************************** 1. row ***************************
  3. Table: query_review
  4. Create Table: CREATE TABLE `query_review` (
  5. `checksum` bigint(20) unsigned NOT NULL,
  6. `fingerprint` text NOT NULL,
  7. `sample` text NOT NULL,
  8. `first_seen` datetime DEFAULT NULL,
  9. `last_seen` datetime DEFAULT NULL,
  10. `reviewed_by` varchar(20) DEFAULT NULL,
  11. `reviewed_on` datetime DEFAULT NULL,
  12. `comments` text,
  13. PRIMARY KEY (`checksum`)
  14. ) ENGINE=InnoDB DEFAULT CHARSET=latin1

pt-query-digest的更多相关文章

  1. [hdu 6191] Query on A Tree

    Query on A Tree Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 132768/132768 K (Java/Othe ...

  2. MYSQL 5.7 新增150多个新功能

    http://www.thecompletelistoffeatures.com/ There are over 150 new features in MySQL 5.7. The MySQL ma ...

  3. bzoj2243 sdoi2011 染色 paint

    明明是裸树剖 竟然调了这么久好蛋疼 大概是自己比较水的原因吧 顺便+fastio来gangbang #include<iostream> #include<cstring> # ...

  4. MySQL中的空间扩展

    目录 19.1. 前言 19.2. OpenGIS几何模型 19.2.1. Geometry类的层次 19.2.2. 类Geometry 19.2.3. 类Point 19.2.4. 类Curve 1 ...

  5. MySQL ProxySQL读写分离使用初探

    目的 在美团点评DBProxy读写分离使用说明文章中已经说明了使用目的,本文介绍ProxySQL的使用方法以及和DBProxy的性能差异.具体的介绍可以看官网的相关说明,并且这个中间件也是percon ...

  6. UOJ#407. 【IOI2018】狼人 Kruskal,kruskal重构树,主席树

    原文链接https://www.cnblogs.com/zhouzhendong/p/UOJ407.html 题解 套路啊. 先按照两个节点顺序各搞一个kruskal重构树,然后问题转化成两棵krus ...

  7. UOJ#218. 【UNR #1】火车管理 线段树 主席树

    原文链接https://www.cnblogs.com/zhouzhendong/p/UOJ218.html 题解 如果我们可以知道每次弹出栈之后新的栈顶是什么,那么我们就可以在一棵区间覆盖.区间求和 ...

  8. BZOJ 3514: Codechef MARCH14 GERALD07加强版(LCT + 主席树)

    题意 \(N\) 个点 \(M\) 条边的无向图,询问保留图中编号在 \([l,r]\) 的边的时候图中的联通块个数. \(K\) 次询问强制在线. \(1\le N,M,K \le 200,000\ ...

  9. 51Nod1863 Travel 主席树 最短路 Dijkstra 哈希

    原文链接https://www.cnblogs.com/zhouzhendong/p/51Nod1863.html 题目传送门 - 51Nod1863 题意 有 n 个城市,有 m 条双向路径连通它们 ...

  10. BZOJ2821 作诗(Poetize) 主席树 bitset

    原文链接https://www.lydsy.com/JudgeOnline/problem.php?id=2821 题目传送门 - BZOJ2821 题意 $n$ 个数,$m$ 组询问,每次问 $[l ...

随机推荐

  1. Codeforces Round #441 (Div. 2, by Moscow Team Olympiad) D. Sorting the Coins

    http://codeforces.com/contest/876/problem/D 题意: 最开始有一串全部由"O"组成的字符串,现在给出n个数字,指的是每次把位置n上的&qu ...

  2. 最火的Android开源项目(一)

    摘要:对于开发者而言,了解当下比较流行的开源项目很是必要.利用这些项目,有时能够让你达到事半功倍的效果.为此,CSDN特整理了GitHub上最受欢迎的Android及iOS开源项目,本文详细介绍了20 ...

  3. invalid types 'int[int]' for array subscript// EOF 输入多组数据//如何键盘输入EOF

    数组维度搞错了 一次运行,要输入多组数据,直到读至输入文件末尾(EOF)为止 while(scanf("%d %d",&a, &b) != EOF) // 输入结束 ...

  4. 张高兴的 Xamarin.Android 学习笔记:(三)活动生命周期

    本文将直接解释我写的一个示例.示例目的在于展示 Android 活动在 Xamarin 中的用法.如果有朋友对基础知识不太了解建议先学 Android . 新建一个 Xamarin.Android 项 ...

  5. 详解变量声明加 var 和不加 var 的区别

    在全局作用域中声明变量加 var 关键字和不加 var ,js 引擎都会将这个变量声明为全局变量,在实际运行时,两种声明方式的变量的行为也是几乎一致的.但是在全局作用域下是否声明一个变量的 时候加va ...

  6. 微信开发-微信JSSDK错误:invalid url domain

    错误类型:invalid url domain 调试返回参数: { "errMsg": "config:invalid url domain" } 截图: 环境 ...

  7. Lustre文件系统测试——obdfilter-survey测试

    Lustre文件系统测试--obdfilter-survey测试 介绍 该测试主要是在lustre文件系统工作环境下进行,将直接在ost上生成工作负载模拟并行文件访问,可准确检测盘阵在lustre文件 ...

  8. 【NOIP2016提高组】 Day2 T2 蚯蚓

    题目传送门:https://www.luogu.org/problemnew/show/P2827 自测时被题面所误导...,题面中说逢t的倍数才输出答案,以为有什么玄妙的方法直接将m次操作变成了m/ ...

  9. spring MVC 环境搭建

    绿色版Spring MVC(单纯的springMVC) 一.导包,为了获取请求数据多添加一个包 二.web.xml配置 <?xml version="1.0" encodin ...

  10. mysql 中翻页

    万变不离其中 select * from tableName where 条件 limit 当前页码*页面容量-1 , 页面容量