{"action":"created","issue":{"url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1589","repository_url":"https://api.github.com/repos/MyCATApache/Mycat-Server","labels_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1589/labels{/name}","comments_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1589/comments","events_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1589/events","html_url":"https://github.com/MyCATApache/Mycat-Server/issues/1589","id":245295059,"number":1589,"title":"show @@sql.sum.table 命令的疑问","user":{"login":"352926","id":2149434,"avatar_url":"https://avatars2.githubusercontent.com/u/2149434?v=4","gravatar_id":"","url":"https://api.github.com/users/352926","html_url":"https://github.com/352926","followers_url":"https://api.github.com/users/352926/followers","following_url":"https://api.github.com/users/352926/following{/other_user}","gists_url":"https://api.github.com/users/352926/gists{/gist_id}","starred_url":"https://api.github.com/users/352926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/352926/subscriptions","organizations_url":"https://api.github.com/users/352926/orgs","repos_url":"https://api.github.com/users/352926/repos","events_url":"https://api.github.com/users/352926/events{/privacy}","received_events_url":"https://api.github.com/users/352926/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-25T06:09:14Z","updated_at":"2017-08-02T02:03:56Z","closed_at":null,"body":"show @@sql.sum.table; 这个命令是显示每张表的读写统计\r\n\r\n请问，这个执行后，统计的时间范围是什么时间到什么时间？\r\n\r\n还有就是怎么指定时间范围内的读写统计呢？\r\n\r\n因为mycat-web 那边的统计是不准确的，我一天内只insert 1次，select 1次，但是mycat-web里统计出来的数量却有读写好几百次。\r\n\r\n而我用命令在mycat 9066管理端上查询出来的是对的。\r\n\r\n但是我想知道我怎么来设定统计的范围，比如我取昨天的读写次数呢？\r\n\r\n我翻阅了书本，以及查遍了网络，也没有找到 关于 show @@sql.sum.table 限制时间范围的说明。\r\n\r\n有一些命令后面可以带上where，但是我在这边尝试了无效。\r\n\r\n请大神指导！"},"comment":{"url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/comments/319547155","html_url":"https://github.com/MyCATApache/Mycat-Server/issues/1589#issuecomment-319547155","issue_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1589","id":319547155,"user":{"login":"352926","id":2149434,"avatar_url":"https://avatars2.githubusercontent.com/u/2149434?v=4","gravatar_id":"","url":"https://api.github.com/users/352926","html_url":"https://github.com/352926","followers_url":"https://api.github.com/users/352926/followers","following_url":"https://api.github.com/users/352926/following{/other_user}","gists_url":"https://api.github.com/users/352926/gists{/gist_id}","starred_url":"https://api.github.com/users/352926/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/352926/subscriptions","organizations_url":"https://api.github.com/users/352926/orgs","repos_url":"https://api.github.com/users/352926/repos","events_url":"https://api.github.com/users/352926/events{/privacy}","received_events_url":"https://api.github.com/users/352926/received_events","type":"User","site_admin":false},"created_at":"2017-08-02T02:03:56Z","updated_at":"2017-08-02T02:03:56Z","body":"知道了，多谢，同时找到mycat-web统计不准的原因了，我看了代码发现，mycat-web那边是每隔3分钟判断show @@sql.sum如果读或写>0就记录show @@sql.sum.table的结果，然后根据时间范围进行SUM(R)，SUM(W)累加，实际上应该取MAX会稍微准确点，但是最准确的应该单独再写个脚本来统计：今天R次数 = 今天最后执行时间R - 昨天最后执行的R   或者用sql  MAX(R) - MIN(R) 来计算范围内的次数"}}
{"actor":{"display_login":"352926"}}