/*
Navicat Premium Data Transfer
Source Server : mysqllocal
Source Server Type : MySQL
Source Server Version : 50717
Source Host : localhost:3306
Source Schema : sys
Target Server Type : MySQL
Target Server Version : 50717
File Encoding : 65001
Date: 07/02/2019 23:01:38
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for Access
-- ----------------------------
DROP TABLE IF EXISTS `Access`;
CREATE TABLE `Access` (
`id` bigint(15) NOT NULL AUTO_INCREMENT COMMENT '',
`schema` varchar(20) NOT NULL DEFAULT 'sys' COMMENT '',
`name` varchar(50) NOT NULL COMMENT ' apijson_user',
`alias` varchar(20) DEFAULT NULL COMMENT ' User',
`get` varchar(100) NOT NULL DEFAULT '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT ' get ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]\n JSON JSONArray',
`head` varchar(100) NOT NULL DEFAULT '["UNKNOWN", "LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT ' head ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
`gets` varchar(100) NOT NULL DEFAULT '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT ' gets ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
`heads` varchar(100) NOT NULL DEFAULT '["LOGIN", "CONTACT", "CIRCLE", "OWNER", "ADMIN"]' COMMENT ' heads ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
`post` varchar(100) NOT NULL DEFAULT '["OWNER", "ADMIN"]' COMMENT ' post ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
`put` varchar(100) NOT NULL DEFAULT '["OWNER", "ADMIN"]' COMMENT ' put ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
`delete` varchar(100) NOT NULL DEFAULT '["OWNER", "ADMIN"]' COMMENT ' delete ["LOGIN", "CONTACT", "CIRCLE", "OWNER"]',
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='';
-- ----------------------------
-- Records of Access
-- ----------------------------
BEGIN;
INSERT INTO `Access` VALUES (1, 'sys', 'Table', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[]', '[]', '[]', '2018-11-28 16:38:14');
INSERT INTO `Access` VALUES (2, 'sys', 'Column', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[]', '[]', '[]', '2018-11-28 16:38:14');
INSERT INTO `Access` VALUES (3, 'sys', 'Request', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[]', '[]', '[]', '2018-11-28 16:38:14');
INSERT INTO `Access` VALUES (4, 'sys', 'Response', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[]', '[]', '[]', '2018-11-28 16:38:15');
INSERT INTO `Access` VALUES (5, 'sys', 'Function', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[]', '[]', '[]', '2018-11-28 16:38:15');
INSERT INTO `Access` VALUES (6, 'sys', 'Document', NULL, '[\"LOGIN\", \"ADMIN\"]', '[\"LOGIN\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '2018-11-28 16:38:15');
INSERT INTO `Access` VALUES (7, 'sys', 'Test', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[]', '[]', '[]', '2018-11-28 16:38:15');
INSERT INTO `Access` VALUES (8, 'sys', 'TestRecord', NULL, '[\"LOGIN\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '2018-11-28 16:38:15');
INSERT INTO `Access` VALUES (11, 'sys', 'apijson_user', 'User', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '2018-11-28 16:28:53');
INSERT INTO `Access` VALUES (12, 'sys', 'apijson_privacy', 'Privacy', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '2018-11-28 16:29:48');
INSERT INTO `Access` VALUES (13, 'sys', 'Moment', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '2018-11-28 16:29:19');
INSERT INTO `Access` VALUES (14, 'sys', 'Comment', NULL, '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '[\"OWNER\", \"ADMIN\"]', '2018-11-28 16:29:19');
INSERT INTO `Access` VALUES (15, 'sys', 'Login', NULL, '[]', '[]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[ \"ADMIN\"]', '[ \"ADMIN\"]', '[\"ADMIN\"]', '2018-11-28 16:29:48');
INSERT INTO `Access` VALUES (16, 'sys', 'Verify', NULL, '[]', '[]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]', '[ \"ADMIN\"]', '[\"ADMIN\"]', '2018-11-28 16:29:48');
COMMIT;
-- ----------------------------
-- Table structure for Comment
-- ----------------------------
DROP TABLE IF EXISTS `Comment`;
CREATE TABLE `Comment` (
`id` bigint(15) NOT NULL COMMENT '',
`toId` bigint(15) NOT NULL DEFAULT '0' COMMENT 'id',
`userId` bigint(15) NOT NULL COMMENT 'id',
`momentId` bigint(15) NOT NULL COMMENT 'id',
`date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`content` varchar(1000) NOT NULL COMMENT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='';
-- ----------------------------
-- Records of Comment
-- ----------------------------
BEGIN;
INSERT INTO `Comment` VALUES (4, 0, 38710, 470, '2017-02-01 11:20:50', 'This is a Content...-4');
INSERT INTO `Comment` VALUES (13, 0, 82005, 58, '2017-02-01 11:20:50', 'This is a Content...-13');
INSERT INTO `Comment` VALUES (22, 221, 82001, 470, '2017-02-01 11:20:50', '');
INSERT INTO `Comment` VALUES (44, 0, 82003, 170, '2017-02-01 11:20:50', 'This is a Content...-44');
INSERT INTO `Comment` VALUES (45, 0, 93793, 301, '2017-02-01 11:20:50', 'This is a Content...-45');
INSERT INTO `Comment` VALUES (47, 4, 70793, 470, '2017-02-01 11:20:50', 'This is a Content...-47');
INSERT INTO `Comment` VALUES (51, 45, 82003, 301, '2017-02-01 11:20:50', 'This is a Content...-51');
INSERT INTO `Comment` VALUES (54, 0, 82004, 170, '2017-02-01 11:20:50', 'This is a Content...-54');
INSERT INTO `Comment` VALUES (68, 0, 82005, 371, '2017-02-01 11:20:50', 'This is a Content...-68');
INSERT INTO `Comment` VALUES (76, 45, 93793, 301, '2017-02-01 11:20:50', 'This is a Content...-76');
INSERT INTO `Comment` VALUES (77, 13, 93793, 58, '2017-02-01 11:20:50', 'This is a Content...-77');
INSERT INTO `Comment` VALUES (97, 13, 82006, 58, '2017-02-01 11:20:50', 'This is a Content...-97');
INSERT INTO `Comment` VALUES (99, 44, 70793, 170, '2017-02-01 11:20:50', 'This is a Content...-99');
INSERT INTO `Comment` VALUES (110, 0, 93793, 371, '2017-02-01 11:23:24', 'This is a Content...-110');
INSERT INTO `Comment` VALUES (114, 0, 82001, 371, '2017-03-02 05:56:06', 'This is a Content...-114');
INSERT INTO `Comment` VALUES (115, 0, 38710, 371, '2017-03-02 05:56:06', 'This is a Content...-115');
INSERT INTO `Comment` VALUES (116, 0, 70793, 371, '2017-03-02 05:56:06', 'This is a Content...-116');
INSERT INTO `Comment` VALUES (120, 0, 93793, 301, '2017-03-02 05:56:06', 'This is a Content...-110');
INSERT INTO `Comment` VALUES (124, 0, 82001, 301, '2017-03-02 05:56:06', 'This is a Content...-114');
INSERT INTO `Comment` VALUES (157, 0, 93793, 371, '2017-02-01 11:20:50', 'This is a Content...-157');
INSERT INTO `Comment` VALUES (158, 0, 93793, 301, '2018-07-12 17:28:23', 'This is a Content...-157');
INSERT INTO `Comment` VALUES (160, 0, 82001, 235, '2017-03-02 05:56:06', 'This is a Content...-160');
INSERT INTO `Comment` VALUES (162, 0, 93793, 12, '2017-03-06 05:03:45', 'This is a Content...-162');
INSERT INTO `Comment` VALUES (163, 0, 82001, 235, '2017-03-02 05:56:06', 'This is a Content...-163');
INSERT INTO `Comment` VALUES (164, 0, 93793, 12, '2017-03-06 05:03:45', 'This is a Content...-164');
INSERT INTO `Comment` VALUES (167, 0, 82001, 58, '2017-03-25 11:48:41', 'Nice!');
INSERT INTO `Comment` VALUES (168, 1490442545077, 82001, 235, '2017-03-25 11:49:14', '???');
INSERT INTO `Comment` VALUES (172, 162, 82001, 12, '2017-03-25 12:22:58', 'OK');
INSERT INTO `Comment` VALUES (173, 0, 38710, 58, '2017-03-25 12:25:13', 'Good');
INSERT INTO `Comment` VALUES (175, 0, 38710, 12, '2017-03-25 12:26:53', 'Java is the best program language!');
INSERT INTO `Comment` VALUES (176, 166, 38710, 15, '2017-03-25 12:28:03', 'thank you');
INSERT INTO `Comment` VALUES (178, 0, 38710, 511, '2017-03-25 12:30:55', 'wbw');
INSERT INTO `Comment` VALUES (182, 110, 82001, 371, '2017-03-26 06:12:52', 'hahaha');
INSERT INTO `Comment` VALUES (188, 97, 82001, 58, '2017-03-26 07:21:32', '1646');
INSERT INTO `Comment` VALUES (190, 0, 82001, 58, '2017-03-26 07:22:13', 'dbdj');
INSERT INTO `Comment` VALUES (206, 54, 82001, 170, '2017-03-29 03:04:23', 'ejej');
INSERT INTO `Comment` VALUES (209, 13, 82001, 58, '2017-03-29 03:05:59', 'hehj');
INSERT INTO `Comment` VALUES (300, 97, 82001, 58, '2017-03-29 03:06:07', 'hj');
INSERT INTO `Comment` VALUES (301, 194, 82001, 235, '2017-03-29 03:06:24', 'jj');
INSERT INTO `Comment` VALUES (4001, 0, 82001, 58, '2017-03-29 08:39:52', 'I would like to say ');
INSERT INTO `Comment` VALUES (1490776944301, 0, 82001, 58, '2017-03-29 08:42:24', 'hello');
INSERT INTO `Comment` VALUES (1490776966828, 173, 82001, 58, '2017-03-29 08:42:46', 'me too');
INSERT INTO `Comment` VALUES (1490777905437, 0, 82001, 543, '2017-03-29 08:58:25', 'rr');
INSERT INTO `Comment` VALUES (1490778122719, 175, 82001, 12, '2017-03-29 09:02:02', 'Yeah! I think so!');
INSERT INTO `Comment` VALUES (1490778494751, 1490778122719, 82001, 12, '2017-03-29 09:08:14', 'reply Android82001');
INSERT INTO `Comment` VALUES (1490778681337, 166, 82001, 12, '2017-03-29 09:11:21', 'gg');
INSERT INTO `Comment` VALUES (1490780759866, 99, 82001, 170, '2017-03-29 09:45:59', '99');
INSERT INTO `Comment` VALUES (1490781009548, 51, 82001, 301, '2017-03-29 09:50:09', '3');
INSERT INTO `Comment` VALUES (1490781032005, 45, 82001, 301, '2017-03-29 09:50:32', '93793');
INSERT INTO `Comment` VALUES (1490781817044, 209, 38710, 58, '2017-03-29 10:03:37', '82001');
INSERT INTO `Comment` VALUES (1490781850893, 1490776966828, 38710, 58, '2017-03-29 10:04:10', 'haha!');
INSERT INTO `Comment` VALUES (1490781857242, 190, 38710, 58, '2017-03-29 10:04:17', 'nice');
INSERT INTO `Comment` VALUES (1490781865407, 1490781857242, 38710, 58, '2017-03-29 10:04:25', 'wow');
INSERT INTO `Comment` VALUES (1490781899147, 197, 38710, 12, '2017-03-29 10:04:59', 'kaka');
INSERT INTO `Comment` VALUES (1490794439561, 1490778681337, 82001, 12, '2017-03-29 13:33:59', 'gg?');
INSERT INTO `Comment` VALUES (1490794610632, 172, 82001, 12, '2017-03-29 13:36:50', 'All right');
INSERT INTO `Comment` VALUES (1490794937137, 1490794919957, 82001, 12, '2017-03-29 13:42:17', 'All right ok ok');
INSERT INTO `Comment` VALUES (1490794953438, 1490794937137, 82001, 12, '2017-03-29 13:42:33', 'All right ok ok ll');
INSERT INTO `Comment` VALUES (1490796241178, 0, 38710, 58, '2017-03-29 14:04:01', 'Anything else?');
INSERT INTO `Comment` VALUES (1490796629591, 175, 38710, 12, '2017-03-29 14:10:29', 'well');
INSERT INTO `Comment` VALUES (1490798710678, 110, 38710, 371, '2017-03-29 14:45:10', '110');
INSERT INTO `Comment` VALUES (1490800971064, 175, 38710, 12, '2017-03-29 15:22:51', 'I do');
INSERT INTO `Comment` VALUES (1490848396072, 175, 82001, 12, '2017-03-30 04:33:16', 'Lemon');
INSERT INTO `Comment` VALUES (1490848581424, 166, 82001, 12, '2017-03-30 04:36:21', '82001ejej');
INSERT INTO `Comment` VALUES (1490850764448, 162, 82001, 12, '2017-03-30 05:12:44', '-162');
INSERT INTO `Comment` VALUES (1490850844016, 0, 82001, 12, '2017-03-30 05:14:04', 'I like it');
INSERT INTO `Comment` VALUES (1490850876656, 1490800971064, 82001, 12, '2017-03-30 05:14:36', 'I do so');
INSERT INTO `Comment` VALUES (1490854894566, 175, 82001, 12, '2017-03-30 06:21:34', 'it does be a good lang');
INSERT INTO `Comment` VALUES (1490863443219, 1490850844016, 82002, 12, '2017-03-30 08:44:03', 'me too!');
INSERT INTO `Comment` VALUES (1490863469638, 0, 82002, 15, '2017-03-30 08:44:29', 'Just do it');
INSERT INTO `Comment` VALUES (1490863507114, 4, 82003, 470, '2017-03-30 08:45:07', 'yes');
INSERT INTO `Comment` VALUES (1490863563124, 0, 82003, 704, '2017-03-30 08:46:03', 'I want one');
INSERT INTO `Comment` VALUES (1490863651493, 0, 70793, 595, '2017-03-30 08:47:31', 'wow');
INSERT INTO `Comment` VALUES (1490863661426, 1490780759866, 70793, 170, '2017-03-30 08:47:41', '66');
INSERT INTO `Comment` VALUES (1490863676989, 0, 70793, 12, '2017-03-30 08:47:56', 'Shy');
INSERT INTO `Comment` VALUES (1490863711703, 0, 70793, 511, '2017-03-30 08:48:31', 'I hope I can join');
INSERT INTO `Comment` VALUES (1490863717947, 178, 70793, 511, '2017-03-30 08:48:37', 'what?');
INSERT INTO `Comment` VALUES (1490863783276, 1490863711703, 93793, 511, '2017-03-30 08:49:43', 'haha welcome');
INSERT INTO `Comment` VALUES (1490863903900, 0, 82006, 470, '2017-03-30 08:51:43', 'SOGA');
INSERT INTO `Comment` VALUES (1490863915675, 0, 82006, 235, '2017-03-30 08:51:55', 'Good boy');
INSERT INTO `Comment` VALUES (1490863938712, 0, 82006, 12, '2017-03-30 08:52:18', 'Handsome!');
INSERT INTO `Comment` VALUES (1490863978239, 1490796241178, 82006, 58, '2017-03-30 08:52:58', 'there still remains a question');
INSERT INTO `Comment` VALUES (1490864016738, 0, 82006, 511, '2017-03-30 08:53:36', 'I want to have a try!');
INSERT INTO `Comment` VALUES (1490864023700, 0, 82006, 543, '2017-03-30 08:53:43', 'oops');
INSERT INTO `Comment` VALUES (1490864039264, 0, 82006, 551, '2017-03-30 08:53:59', 'Wonderful!');
INSERT INTO `Comment` VALUES (1490864152008, 0, 82006, 58, '2017-03-30 08:55:52', 'U R ugly( ?` )');
INSERT INTO `Comment` VALUES (1490864254400, 1490863915675, 82044, 235, '2017-03-30 08:57:34', 'And I have no idea');
INSERT INTO `Comment` VALUES (1490864276824, 0, 82044, 12, '2017-03-30 08:57:56', 'Oh my God!');
INSERT INTO `Comment` VALUES (1490864292184, 1490864152008, 82044, 58, '2017-03-30 08:58:12', 'haha!');
INSERT INTO `Comment` VALUES (1490864379424, 1490863938712, 82001, 12, '2017-03-30 08:59:39', 'Thank you~');
INSERT INTO `Comment` VALUES (1490864400210, 1490864276824, 82001, 12, '2017-03-30 09:00:00', 'Amazing, isnt it?');
INSERT INTO `Comment` VALUES (1490874908570, 1490864023700, 82055, 543, '2017-03-30 11:55:08', 'yeah');
INSERT INTO `Comment` VALUES (1490874930994, 1490777905437, 82055, 543, '2017-03-30 11:55:30', 'yy');
INSERT INTO `Comment` VALUES (1490874968779, 0, 82055, 12, '2017-03-30 11:56:08', 'I love it');
INSERT INTO `Comment` VALUES (1490875033494, 0, 82055, 301, '2017-03-30 11:57:13', 'More Comments');
INSERT INTO `Comment` VALUES (1490875040761, 158, 82055, 301, '2017-03-30 11:57:20', '157');
INSERT INTO `Comment` VALUES (1490875046704, 120, 82055, 301, '2017-03-30 11:57:26', '110');
INSERT INTO `Comment` VALUES (1490875660259, 1490863469638, 82055, 15, '2017-03-30 12:07:40', 'I prove wht you said(??????)');
INSERT INTO `Comment` VALUES (1490879678127, 0, 82001, 543, '2017-03-30 13:14:38', 'Baby you are a firework!');
INSERT INTO `Comment` VALUES (1490973736662, 1490973715568, 70793, 170, '2017-03-31 15:22:16', 'Hello, I am a fresh man');
INSERT INTO `Comment` VALUES (1490973890875, 1490864039264, 93793, 551, '2017-03-31 15:24:50', 'While I donot think so');
INSERT INTO `Comment` VALUES (1491014830404, 1490864016738, 82001, 511, '2017-04-01 02:47:10', 'Have a nice day!');
INSERT INTO `Comment` VALUES (1491119615611, 1490864023700, 82001, 543, '2017-04-02 07:53:35', '$$');
INSERT INTO `Comment` VALUES (1491119670185, 68, 82001, 371, '2017-04-02 07:54:30', 'Leave a word');
INSERT INTO `Comment` VALUES (1491119695580, 0, 82001, 371, '2017-04-02 07:54:55', 'leave a word');
INSERT INTO `Comment` VALUES (1491130701902, 0, 38710, 511, '2017-04-02 10:58:21', 'Thanks for your supports (-^?^-)');
INSERT INTO `Comment` VALUES (1491209763162, 0, 82001, 1491200468898, '2017-04-03 08:56:03', 'How do you do');
INSERT INTO `Comment` VALUES (1491277552385, 0, 82001, 58, '2017-04-04 03:45:52', 'Seven');
INSERT INTO `Comment` VALUES (1491312438951, 1490863651493, 82001, 595, '2017-04-04 13:27:18', 'WaKaKa!');
INSERT INTO `Comment` VALUES (1491709064513, 0, 82001, 551, '2017-04-09 03:37:44', 'soga');
INSERT INTO `Comment` VALUES (1491740899179, 0, 82001, 470, '2017-04-09 12:28:19', 'www');
INSERT INTO `Comment` VALUES (1491798370749, 0, 82002, 551, '2017-04-10 04:26:10', 'Nice!');
INSERT INTO `Comment` VALUES (1491798499667, 115, 82002, 371, '2017-04-10 04:28:19', 'I do not understand');
INSERT INTO `Comment` VALUES (1491830543193, 0, 82001, 170, '2017-04-10 13:22:23', 'What is the hell?');
INSERT INTO `Comment` VALUES (1492932228287, 1491209763162, 38710, 1491200468898, '2017-04-23 07:23:48', 'fine,thanks');
INSERT INTO `Comment` VALUES (1493094307810, 0, 82001, 551, '2017-04-25 04:25:04', '');
INSERT INTO `Comment` VALUES (1493094307910, 0, 82001, 551, '2017-04-25 04:26:04', 'POST');
INSERT INTO `Comment` VALUES (1493186363132, 1490850764448, 82001, 12, '2017-04-26 05:59:23', 'sndnd');
INSERT INTO `Comment` VALUES (1502632433970, 0, 82002, 1493835799335, '2017-08-13 13:53:53', 'just have fun!');
INSERT INTO `Comment` VALUES (1508053783278, 0, 82001, 1508053762227, '2017-10-15 07:49:43', '');
INSERT INTO `Comment` VALUES (1508072695833, 0, 82003, 1508072633830, '2017-10-15 13:04:55', '(`)');
INSERT INTO `Comment` VALUES (1508227456407, 0, 82001, 15, '2017-10-17 08:04:16', 'hsh');
INSERT INTO `Comment` VALUES (1508227498578, 1491798370749, 82001, 551, '2017-10-17 08:04:58', 'g');
INSERT INTO `Comment` VALUES (1508462026394, 1490850844016, 82001, 12, '2017-10-20 01:13:46', '');
INSERT INTO `Comment` VALUES (1508492585904, 1508462026394, 82001, 12, '2017-10-20 09:43:05', 'my god');
INSERT INTO `Comment` VALUES (1509003045509, 0, 82001, 1508072633830, '2017-10-26 07:30:45', 'hhh');
INSERT INTO `Comment` VALUES (1509346549158, 0, 82001, 170, '2017-10-30 06:55:49', '');
INSERT INTO `Comment` VALUES (1509346556395, 0, 82001, 170, '2017-10-30 06:55:56', '');
INSERT INTO `Comment` VALUES (1509346606036, 0, 82001, 15, '2017-10-30 06:56:46', '');
INSERT INTO `Comment` VALUES (1509518079106, 0, 82001, 1508073178489, '2017-11-01 06:34:39', '');
INSERT INTO `Comment` VALUES (1510795816462, 162, 82001, 12, '2017-11-16 01:30:16', '');
INSERT INTO `Comment` VALUES (1510795933629, 0, 82001, 1508073178489, '2017-11-16 01:32:13', 'cc');
INSERT INTO `Comment` VALUES (1510813284894, 0, 82001, 12, '2017-11-16 06:21:24', 'asdasdasdas');
INSERT INTO `Comment` VALUES (1510813295700, 162, 82001, 12, '2017-11-16 06:21:35', 'adsdasdasdasd');
INSERT INTO `Comment` VALUES (1511374269759, 99, 82001, 170, '2017-11-22 18:11:09', '');
INSERT INTO `Comment` VALUES (1511374274194, 0, 82001, 170, '2017-11-22 18:11:14', '');
INSERT INTO `Comment` VALUES (1511407695342, 0, 1511407581570, 371, '2017-11-23 03:28:15', '');
INSERT INTO `Comment` VALUES (1511407702981, 157, 1511407581570, 371, '2017-11-23 03:28:22', '');
INSERT INTO `Comment` VALUES (1511878024415, 0, 1511761906715, 12, '2017-11-28 14:07:04', '');
INSERT INTO `Comment` VALUES (1511878031610, 1511878024415, 1511761906715, 12, '2017-11-28 14:07:11', '');
INSERT INTO `Comment` VALUES (1512035094555, 0, 82001, 12, '2017-11-30 09:44:54', '');
INSERT INTO `Comment` VALUES (1512035117021, 0, 82001, 32, '2017-11-30 09:45:17', '');
INSERT INTO `Comment` VALUES (1512038831617, 1512035117021, 82001, 32, '2017-11-30 10:47:11', '2kGitHubZBLibray(UILGlide)');
INSERT INTO `Comment` VALUES (1512039030970, 1512035117021, 82001, 32, '2017-11-30 10:50:30', '300*3001080P');
INSERT INTO `Comment` VALUES (1512531859019, 0, 1512531601485, 1512314438990, '2017-12-06 03:44:19', '666');
INSERT INTO `Comment` VALUES (1512533520832, 1512531859019, 38710, 1512314438990, '2017-12-06 04:12:00', '');
INSERT INTO `Comment` VALUES (1513656045399, 0, 82001, 1508072633830, '2017-12-19 04:00:45', '444444');
INSERT INTO `Comment` VALUES (1514425796195, 0, 82001, 1513094436910, '2017-12-28 01:49:56', '');
INSERT INTO `Comment` VALUES (1514473034425, 1514425796195, 93793, 1513094436910, '2017-12-28 14:57:14', '');
INSERT INTO `Comment` VALUES (1514478784653, 0, 82001, 1513094436910, '2017-12-28 16:33:04', 'bug');
INSERT INTO `Comment` VALUES (1514506206319, 1514478784653, 38710, 1513094436910, '2017-12-29 00:10:06', '^_^');
INSERT INTO `Comment` VALUES (1514617131036, 0, 82005, 1513094436910, '2017-12-30 06:58:51', '');
INSERT INTO `Comment` VALUES (1514858592813, 0, 82001, 1514858533480, '2018-01-02 02:03:12', '');
INSERT INTO `Comment` VALUES (1514858640958, 0, 38710, 1514858533480, '2018-01-02 02:04:00', '');
INSERT INTO `Comment` VALUES (1514858707767, 0, 70793, 1514858533480, '2018-01-02 02:05:07', '');
INSERT INTO `Comment` VALUES (1514960713300, 0, 82001, 1513094436910, '2018-01-03 06:25:13', '1');
INSERT INTO `Comment` VALUES (1514960744185, 1512531859019, 82001, 1512314438990, '2018-01-03 06:25:44', '');
INSERT INTO `Comment` VALUES (1515057852156, 0, 82001, 58, '2018-01-04 09:24:12', '');
INSERT INTO `Comment` VALUES (1515057857464, 0, 82001, 58, '2018-01-04 09:24:17', '');
INSERT INTO `Comment` VALUES (1515057861094, 0, 82001, 58, '2018-01-04 09:24:21', '');
INSERT INTO `Comment` VALUES (1515057864174, 1515057857464, 82001, 58, '2018-01-04 09:24:24', '');
INSERT INTO `Comment` VALUES (1515057869554, 0, 82001, 58, '2018-01-04 09:24:29', ',');
INSERT INTO `Comment` VALUES (1515313792063, 162, 82001, 12, '2018-01-07 08:29:52', 'you');
INSERT INTO `Comment` VALUES (1515313823155, 164, 82001, 12, '2018-01-07 08:30:23', 'you');
INSERT INTO `Comment` VALUES (1516190557098, 0, 82001, 1513094436910, '2018-01-17 12:02:37', '');
INSERT INTO `Comment` VALUES (1516629533520, 0, 82001, 1508072633830, '2018-01-22 13:58:53', '');
INSERT INTO `Comment` VALUES (1516686985310, 0, 82001, 1516086423441, '2018-01-23 05:56:25', 'hologram');
INSERT INTO `Comment` VALUES (1516687072270, 1516629533520, 82001, 1508072633830, '2018-01-23 05:57:52', '');
INSERT INTO `Comment` VALUES (1516687437251, 1516686985310, 82001, 1516086423441, '2018-01-23 06:03:57', '');
INSERT INTO `Comment` VALUES (1516691119239, 1516686985310, 38710, 1516086423441, '2018-01-23 07:05:19', 'Hololens');
INSERT INTO `Comment` VALUES (1516780129884, 0, 82001, 1516086423441, '2018-01-24 07:48:49', 'aaa');
INSERT INTO `Comment` VALUES (1516783920998, 0, 82001, 1513094436910, '2018-01-24 08:52:00', '');
INSERT INTO `Comment` VALUES (1516785657724, 0, 82001, 1516086423441, '2018-01-24 09:20:57', 'hj');
INSERT INTO `Comment` VALUES (1516805226757, 1516785657724, 38710, 1516086423441, '2018-01-24 14:47:06', '');
INSERT INTO `Comment` VALUES (1516805340593, 1516783920998, 38710, 1513094436910, '2018-01-24 14:49:00', ' QQQQ');
INSERT INTO `Comment` VALUES (1516843720270, 1516780129884, 82001, 1516086423441, '2018-01-25 01:28:40', 'ghj');
INSERT INTO `Comment` VALUES (1516862537978, 1515057869554, 70793, 58, '2018-01-25 06:42:17', '');
INSERT INTO `Comment` VALUES (1516931850067, 0, 82001, 1516086423441, '2018-01-26 01:57:30', '1111111111111');
INSERT INTO `Comment` VALUES (1516951734010, 1514506206319, 82001, 1513094436910, '2018-01-26 07:28:54', '');
INSERT INTO `Comment` VALUES (1516951754620, 0, 82001, 1513094436910, '2018-01-26 07:29:14', '');
INSERT INTO `Comment` VALUES (1516951826863, 0, 82001, 170, '2018-01-26 07:30:26', '');
INSERT INTO `Comment` VALUES (1517193267472, 1513656045399, 82001, 1508072633830, '2018-01-29 02:34:27', '1');
INSERT INTO `Comment` VALUES (1517193278459, 0, 82001, 1508072633830, '2018-01-29 02:34:38', '112');
INSERT INTO `Comment` VALUES (1517229342303, 0, 82001, 1516086423441, '2018-01-29 12:35:42', '');
INSERT INTO `Comment` VALUES (1517234768450, 1517229342303, 93793, 1516086423441, '2018-01-29 14:06:08', '9');
INSERT INTO `Comment` VALUES (1517303775429, 1490863903900, 82001, 470, '2018-01-30 09:16:15', '');
INSERT INTO `Comment` VALUES (1517375165233, 0, 82001, 1508053762227, '2018-01-31 05:06:05', '666');
INSERT INTO `Comment` VALUES (1517730034960, 0, 82001, 170, '2018-02-04 07:40:34', '');
INSERT INTO `Comment` VALUES (1518365470893, 44, 82001, 170, '2018-02-11 16:11:10', '');
INSERT INTO `Comment` VALUES (1518614899681, 0, 82001, 301, '2018-02-14 13:28:19', 'https://goo.gl/search/JJB+Sports\nJJB Sports,');
INSERT INTO `Comment` VALUES (1519719341810, 0, 82001, 1516086423441, '2018-02-27 08:15:41', '');
INSERT INTO `Comment` VALUES (1519793574249, 1519719341810, 93793, 1516086423441, '2018-02-28 04:52:54', '');
INSERT INTO `Comment` VALUES (1519813825959, 0, 82001, 1516086423441, '2018-02-28 10:30:25', 'P');
INSERT INTO `Comment` VALUES (1519974842508, 0, 82001, 1516086423441, '2018-03-02 07:14:02', '1111');
INSERT INTO `Comment` VALUES (1519974868848, 1516691119239, 82001, 1516086423441, '2018-03-02 07:14:28', '1111');
INSERT INTO `Comment` VALUES (1519979533242, 0, 82001, 1508072633830, '2018-03-02 08:32:13', 'hj');
INSERT INTO `Comment` VALUES (1520231250819, 0, 82001, 12, '2018-03-05 06:27:30', '');
INSERT INTO `Comment` VALUES (1520264640815, 0, 70793, 1520242333325, '2018-03-05 15:44:00', '');
INSERT INTO `Comment` VALUES (1520330788006, 0, 1520242280259, 1514017444961, '2018-03-06 10:06:28', '');
INSERT INTO `Comment` VALUES (1520578883309, 0, 82001, 12, '2018-03-09 07:01:23', '');
INSERT INTO `Comment` VALUES (1520699466219, 1520578883309, 82001, 12, '2018-03-10 16:31:06', '');
INSERT INTO `Comment` VALUES (1522074343188, 1513656045399, 82001, 1508072633830, '2018-03-26 14:25:43', 'rrrrr');
INSERT INTO `Comment` VALUES (1522074360206, 1519979533242, 82001, 1508072633830, '2018-03-26 14:26:00', 'tttt');
INSERT INTO `Comment` VALUES (1522657767636, 120, 82001, 301, '2018-04-02 08:29:27', '');
INSERT INTO `Comment` VALUES (1522741138316, 1517193278459, 82001, 1508072633830, '2018-04-03 07:38:58', '');
INSERT INTO `Comment` VALUES (1522986959852, 1508072695833, 82001, 1508072633830, '2018-04-06 03:55:59', '');
INSERT INTO `Comment` VALUES (1523936378484, 0, 1523935772553, 1523936332614, '2018-04-17 03:39:38', '');
INSERT INTO `Comment` VALUES (1524032180807, 1519719341810, 82001, 1516086423441, '2018-04-18 06:16:20', '');
INSERT INTO `Comment` VALUES (1524032244441, 1519974842508, 82001, 1516086423441, '2018-04-18 06:17:24', '?');
INSERT INTO `Comment` VALUES (1524032255755, 1519974842508, 82001, 1516086423441, '2018-04-18 06:17:35', '');
INSERT INTO `Comment` VALUES (1524032299622, 0, 82001, 1516086423441, '2018-04-18 06:18:19', '');
INSERT INTO `Comment` VALUES (1524032305810, 1524032299622, 82001, 1516086423441, '2018-04-18 06:18:25', '');
INSERT INTO `Comment` VALUES (1524178495587, 0, 1524042900591, 1524178455305, '2018-04-19 22:54:55', '');
INSERT INTO `Comment` VALUES (1524178500568, 1524178495587, 1524042900591, 1524178455305, '2018-04-19 22:55:00', '');
INSERT INTO `Comment` VALUES (1524190367904, 0, 38710, 1524178455305, '2018-04-20 02:12:47', 'url');
INSERT INTO `Comment` VALUES (1524190412418, 1524190367904, 38710, 1524178455305, '2018-04-20 02:13:32', '>>');
INSERT INTO `Comment` VALUES (1524190941111, 1524032244441, 82003, 1516086423441, '2018-04-20 02:22:21', '');
INSERT INTO `Comment` VALUES (1524190981549, 1522657767636, 82003, 301, '2018-04-20 02:23:01', '6');
INSERT INTO `Comment` VALUES (1524191012552, 0, 82003, 1524178455305, '2018-04-20 02:23:32', '');
INSERT INTO `Comment` VALUES (1524214012015, 1524190367904, 1524042900591, 1524178455305, '2018-04-20 08:46:52', 'url');
INSERT INTO `Comment` VALUES (1524235902970, 1524214012015, 82003, 1524178455305, '2018-04-20 14:51:42', '');
INSERT INTO `Comment` VALUES (1524297798490, 0, 82001, 1513094436910, '2018-04-21 08:03:18', 'gg');
INSERT INTO `Comment` VALUES (1524461430874, 1519979533242, 82001, 1508072633830, '2018-04-23 05:30:30', '');
INSERT INTO `Comment` VALUES (1524461436914, 0, 82001, 1508072633830, '2018-04-23 05:30:36', '');
INSERT INTO `Comment` VALUES (1524461441914, 0, 82001, 1508072633830, '2018-04-23 05:30:41', '');
INSERT INTO `Comment` VALUES (1524488068926, 1524178500568, 82001, 1524178455305, '2018-04-23 12:54:28', '');
INSERT INTO `Comment` VALUES (1524582671132, 1524461441914, 82003, 1508072633830, '2018-04-24 15:11:11', '');
INSERT INTO `Comment` VALUES (1524582716289, 1524461441914, 70793, 1508072633830, '2018-04-24 15:11:56', '');
INSERT INTO `Comment` VALUES (1524798402799, 0, 1523626157302, 1524178455305, '2018-04-27 03:06:42', 'url');
INSERT INTO `Comment` VALUES (1524799118232, 0, 1523626157302, 1512314438990, '2018-04-27 03:18:38', '');
INSERT INTO `Comment` VALUES (1524843908458, 1524799118232, 82001, 1512314438990, '2018-04-27 15:45:08', 'HttpRequest.addMomentAPIJSONServer Demourl');
INSERT INTO `Comment` VALUES (1524844181029, 1524798402799, 82001, 1524178455305, '2018-04-27 15:49:41', 'DemoAPIJSONDemourl^_^');
INSERT INTO `Comment` VALUES (1524844222775, 1524798402799, 82001, 1524178455305, '2018-04-27 15:50:22', 'url');
INSERT INTO `Comment` VALUES (1525658333654, 0, 82001, 1513094436910, '2018-05-07 01:58:53', 'q');
INSERT INTO `Comment` VALUES (1527821844576, 0, 1527821445610, 1527821296110, '2018-06-01 02:57:24', '');
INSERT INTO `Comment` VALUES (1527821876802, 1527821844576, 1527495857924, 1527821296110, '2018-06-01 02:57:56', '');
INSERT INTO `Comment` VALUES (1527837906576, 0, 38710, 1527830331780, '2018-06-01 07:25:06', '');
INSERT INTO `Comment` VALUES (1527837965006, 0, 82002, 1527830474378, '2018-06-01 07:26:05', '');
INSERT INTO `Comment` VALUES (1527862540820, 0, 1527495857924, 1527830331780, '2018-06-01 14:15:40', '');
INSERT INTO `Comment` VALUES (1527862609352, 1527837965006, 1527495857924, 1527830474378, '2018-06-01 14:16:49', '()');
INSERT INTO `Comment` VALUES (1528105592852, 0, 82001, 1516086423441, '2018-06-04 09:46:32', 'aaaaa');
INSERT INTO `Comment` VALUES (1528250648974, 0, 82001, 1523936332614, '2018-06-06 02:04:08', 'hshdv');
INSERT INTO `Comment` VALUES (1528270188205, 0, 1528250827953, 1527830474378, '2018-06-06 07:29:48', '');
INSERT INTO `Comment` VALUES (1528278187969, 0, 82001, 470, '2018-06-06 09:43:07', '');
INSERT INTO `Comment` VALUES (1528289446172, 0, 82001, 1528269988360, '2018-06-06 12:50:46', 'APIJSONAppAPIJSON');
INSERT INTO `Comment` VALUES (1528289580140, 0, 38710, 1528274037224, '2018-06-06 12:53:00', 'urlurlWebView');
INSERT INTO `Comment` VALUES (1528327885509, 1528289580140, 1528250827953, 1528274037224, '2018-06-06 23:31:25', '');
INSERT INTO `Comment` VALUES (1528333168328, 0, 82001, 1514017444961, '2018-06-07 00:59:28', 'zj');
INSERT INTO `Comment` VALUES (1528333174811, 0, 82001, 1514017444961, '2018-06-07 00:59:34', 'xj');
INSERT INTO `Comment` VALUES (1528393204569, 1528270188205, 38710, 1527830474378, '2018-06-07 17:40:04', 'pictureListurl');
INSERT INTO `Comment` VALUES (1528463152459, 1528463135762, 1528339692804, 1528462217322, '2018-06-08 13:05:52', '');
INSERT INTO `Comment` VALUES (1528463165903, 0, 1528339692804, 1528462217322, '2018-06-08 13:06:05', '');
INSERT INTO `Comment` VALUES (1528516951218, 0, 82001, 1528462217322, '2018-06-09 04:02:31', '()');
INSERT INTO `Comment` VALUES (1528531711651, 0, 82001, 543, '2018-06-09 08:08:31', 'fn');
INSERT INTO `Comment` VALUES (1528554476310, 0, 82001, 1516086423441, '2018-06-09 14:27:56', 'thS');
INSERT INTO `Comment` VALUES (1528676480604, 0, 1528339692804, 1528356421201, '2018-06-11 00:21:20', 'nihshs');
INSERT INTO `Comment` VALUES (1528677257985, 0, 1528339692804, 1528676875139, '2018-06-11 00:34:17', 'aaa');
INSERT INTO `Comment` VALUES (1528679814166, 0, 1528339692804, 1528676875139, '2018-06-11 01:16:54', '12');
INSERT INTO `Comment` VALUES (1528681265496, 1528516951218, 1528339692804, 1528462217322, '2018-06-11 01:41:05', '');
INSERT INTO `Comment` VALUES (1528698907535, 0, 82001, 1516086423441, '2018-06-11 06:35:07', 'yhbv');
INSERT INTO `Comment` VALUES (1528703971675, 1528681265496, 82001, 1528462217322, '2018-06-11 07:59:31', '*(*)');
INSERT INTO `Comment` VALUES (1528799506317, 1516805340593, 82001, 1513094436910, '2018-06-12 10:31:46', '');
INSERT INTO `Comment` VALUES (1528972547638, 0, 82001, 1528462217322, '2018-06-14 10:35:47', '');
INSERT INTO `Comment` VALUES (1528972555336, 0, 82001, 1528462217322, '2018-06-14 10:35:55', 'vvi');
INSERT INTO `Comment` VALUES (1529730035521, 0, 82001, 1527830331780, '2018-06-23 05:00:35', '');
INSERT INTO `Comment` VALUES (1530528524447, 0, 38710, 1528269988360, '2018-07-02 10:48:44', 'HttpRequesturl');
INSERT INTO `Comment` VALUES (1531063660028, 0, 82003, 1531062713966, '2018-07-08 15:27:40', '');
INSERT INTO `Comment` VALUES (1531412238453, 0, 82001, 1528356378455, '2018-07-12 16:17:18', '');
INSERT INTO `Comment` VALUES (1531412264667, 0, 82003, 1528356378455, '2018-07-12 16:17:44', '');
INSERT INTO `Comment` VALUES (1531887938362, 1531063660028, 82001, 1531062713966, '2018-07-18 04:25:38', '');
INSERT INTO `Comment` VALUES (1531894411487, 0, 82001, 1520242333325, '2018-07-18 06:13:31', 'sssx');
INSERT INTO `Comment` VALUES (1531983163150, 0, 1531969715979, 1531969818357, '2018-07-19 06:52:43', 'http://q18idc.com');
INSERT INTO `Comment` VALUES (1532057419100, 0, 38710, 1531969818357, '2018-07-20 03:30:19', '');
INSERT INTO `Comment` VALUES (1533008631299, 1532057419100, 82001, 1531969818357, '2018-07-31 03:43:51', '');
INSERT INTO `Comment` VALUES (1533120405110, 1516780129884, 82001, 1516086423441, '2018-08-01 10:46:45', 'eeeeee');
INSERT INTO `Comment` VALUES (1533120420498, 1528105592852, 82001, 1516086423441, '2018-08-01 10:47:00', 'eeeeeee');
INSERT INTO `Comment` VALUES (1533186909764, 0, 82001, 1531969818357, '2018-08-02 05:15:09', 'hello');
INSERT INTO `Comment` VALUES (1533187733941, 0, 82001, 1508072633830, '2018-08-02 05:28:53', '');
INSERT INTO `Comment` VALUES (1533188056603, 1531887938362, 82001, 1531062713966, '2018-08-02 05:34:16', '');
INSERT INTO `Comment` VALUES (1533195207026, 0, 82001, 1531062713966, '2018-08-02 07:33:27', 'JJ');
INSERT INTO `Comment` VALUES (1533202426013, 1533186909764, 82003, 1531969818357, '2018-08-02 09:33:46', 'world');
INSERT INTO `Comment` VALUES (1533202917743, 1533186909764, 82001, 1531969818357, '2018-08-02 09:41:57', '00');
INSERT INTO `Comment` VALUES (1533629063261, 0, 82001, 1531969818357, '2018-08-07 08:04:23', '');
INSERT INTO `Comment` VALUES (1533631893738, 0, 82001, 1531969818357, '2018-08-07 08:51:33', '');
INSERT INTO `Comment` VALUES (1533809879340, 1533186909764, 82001, 1531969818357, '2018-08-09 10:17:59', '434');
INSERT INTO `Comment` VALUES (1533889646344, 0, 82001, 1508072491570, '2018-08-10 08:27:26', '11111111');
INSERT INTO `Comment` VALUES (1533902815448, 0, 82001, 1531969818357, '2018-08-10 12:06:55', '');
INSERT INTO `Comment` VALUES (1533902902749, 0, 82001, 1531969818357, '2018-08-10 12:08:22', '');
INSERT INTO `Comment` VALUES (1534053913157, 1524190941111, 1508072160401, 1516086423441, '2018-08-12 06:05:13', '');
INSERT INTO `Comment` VALUES (1534128014211, 0, 82001, 1520242333325, '2018-08-13 02:40:14', 'zxxx');
INSERT INTO `Comment` VALUES (1534412022857, 0, 82001, 1531969818357, '2018-08-16 09:33:42', 'dgf');
INSERT INTO `Comment` VALUES (1534684074665, 1531983163150, 82001, 1531969818357, '2018-08-19 13:07:54', 'ggggg');
INSERT INTO `Comment` VALUES (1534684209052, 110, 82001, 371, '2018-08-19 13:10:09', '44444444444444444444444444');
INSERT INTO `Comment` VALUES (1534926143012, 0, 82001, 1508053762227, '2018-08-22 08:22:23', '');
INSERT INTO `Comment` VALUES (1534926149638, 1517375165233, 82001, 1508053762227, '2018-08-22 08:22:29', '');
INSERT INTO `Comment` VALUES (1534992151350, 0, 82001, 1516086423441, '2018-08-23 02:42:31', '');
INSERT INTO `Comment` VALUES (1535279823332, 0, 82001, 1520242333325, '2018-08-26 10:37:03', '');
INSERT INTO `Comment` VALUES (1535279827983, 0, 82001, 1520242333325, '2018-08-26 10:37:07', '');
INSERT INTO `Comment` VALUES (1535598334136, 1534992151350, 82003, 1516086423441, '2018-08-30 03:05:34', '');
INSERT INTO `Comment` VALUES (1535600352436, 0, 82001, 1520242333325, '2018-08-30 03:39:12', '6666666');
INSERT INTO `Comment` VALUES (1535600430479, 0, 82001, 1520242333325, '2018-08-30 03:40:30', '');
INSERT INTO `Comment` VALUES (1535785537390, 1535279823332, 82003, 1520242333325, '2018-09-01 07:05:37', '');
INSERT INTO `Comment` VALUES (1535785585222, 1534926143012, 82003, 1508053762227, '2018-09-01 07:06:25', '');
INSERT INTO `Comment` VALUES (1535963519864, 0, 82001, 1535781636403, '2018-09-03 08:31:59', 'gghhh');
INSERT INTO `Comment` VALUES (1535963525135, 1535963519864, 82001, 1535781636403, '2018-09-03 08:32:05', 'gyuji');
INSERT INTO `Comment` VALUES (1536337000073, 1516686985310, 82001, 1516086423441, '2018-09-07 16:16:40', 'heh');
INSERT INTO `Comment` VALUES (1536378833060, 0, 82001, 1508072633830, '2018-09-08 03:53:53', '');
INSERT INTO `Comment` VALUES (1536469270492, 0, 82001, 1528356496939, '2018-09-09 05:01:10', '(|||)');
INSERT INTO `Comment` VALUES (1536805661269, 0, 70793, 1536805585275, '2018-09-13 02:27:41', '6s');
INSERT INTO `Comment` VALUES (1537373307627, 0, 82001, 1516086423441, '2018-09-19 16:08:27', '');
INSERT INTO `Comment` VALUES (1537410620002, 0, 82001, 1536805585275, '2018-09-20 02:30:20', '');
INSERT INTO `Comment` VALUES (1537710348414, 0, 82001, 1516086423441, '2018-09-23 13:45:48', 'hhj');
INSERT INTO `Comment` VALUES (1537710359760, 0, 82001, 1516086423441, '2018-09-23 13:45:59', '');
INSERT INTO `Comment` VALUES (1537857324518, 0, 82001, 1536805585275, '2018-09-25 06:35:24', '');
INSERT INTO `Comment` VALUES (1537857334299, 1537857324518, 82001, 1536805585275, '2018-09-25 06:35:34', '');
INSERT INTO `Comment` VALUES (1539252343243, 1539252313711, 82001, 15, '2018-10-11 10:05:43', 'dxdf');
INSERT INTO `Comment` VALUES (1539252350604, 1539252337210, 82001, 15, '2018-10-11 10:05:50', 'djdnjd');
INSERT INTO `Comment` VALUES (1539592963862, 0, 82001, 1516086423441, '2018-10-15 08:42:43', '1111');
INSERT INTO `Comment` VALUES (1539868250267, 1531063660028, 82001, 1531062713966, '2018-10-18 13:10:50', '555555555555555555');
INSERT INTO `Comment` VALUES (1539868258868, 1533188056603, 82001, 1531062713966, '2018-10-18 13:10:58', '555555555');
INSERT INTO `Comment` VALUES (1539868269471, 1539868250267, 82001, 1531062713966, '2018-10-18 13:11:09', '4444444444444');
INSERT INTO `Comment` VALUES (1539868275645, 1531887938362, 82001, 1531062713966, '2018-10-18 13:11:15', '22222222222222222');
INSERT INTO `Comment` VALUES (1539960436993, 0, 82001, 1539868023868, '2018-10-19 14:47:16', '111');
INSERT INTO `Comment` VALUES (1540459429565, 0, 82001, 1540459361744, '2018-10-25 09:23:49', '');
INSERT INTO `Comment` VALUES (1541496033857, 0, 82001, 301, '2018-11-06 09:20:33', '');
INSERT INTO `Comment` VALUES (1541651688961, 1539960436993, 82001, 1539868023868, '2018-11-08 04:34:48', '');
INSERT INTO `Comment` VALUES (1541814609499, 0, 82001, 1541667920272, '2018-11-10 01:50:09', '11');
INSERT INTO `Comment` VALUES (1541814627709, 0, 82001, 1540459361744, '2018-11-10 01:50:27', '1111');
INSERT INTO `Comment` VALUES (1541815269164, 0, 82001, 1541667945772, '2018-11-10 02:01:09', '11');
INSERT INTO `Comment` VALUES (1541816372114, 0, 82001, 1541684010904, '2018-11-10 02:19:32', '111');
INSERT INTO `Comment` VALUES (1543193682067, 0, 1528339692804, 1528269822710, '2018-11-26 00:54:42', 'ss');
INSERT INTO `Comment` VALUES (1543463677434, 1541816372114, 82001, 1541684010904, '2018-11-29 03:54:37', 'djdjjj');
INSERT INTO `Comment` VALUES (1544496611006, 0, 82001, 15, '2018-12-11 02:50:11', '');
INSERT INTO `Comment` VALUES (1544496618728, 0, 82001, 15, '2018-12-11 02:50:18', '');
INSERT INTO `Comment` VALUES (1544496620126, 0, 82001, 15, '2018-12-11 02:50:20', '');
INSERT INTO `Comment` VALUES (1544503960414, 1537410620002, 1544503822963, 1536805585275, '2018-12-11 04:52:40', '664984');
INSERT INTO `Comment` VALUES (1544514743789, 0, 82001, 1544497353863, '2018-12-11 07:52:23', '');
INSERT INTO `Comment` VALUES (1544514759556, 1544514743789, 82001, 1544497353863, '2018-12-11 07:52:39', '');
INSERT INTO `Comment` VALUES (1544514788248, 1544514743789, 82001, 1544497353863, '2018-12-11 07:53:08', '');
INSERT INTO `Comment` VALUES (1544514802708, 0, 82001, 1544497355630, '2018-12-11 07:53:22', '');
INSERT INTO `Comment` VALUES (1544514806180, 1544514802708, 82001, 1544497355630, '2018-12-11 07:53:26', '');
INSERT INTO `Comment` VALUES (1544519833507, 1544514788248, 82001, 1544497353863, '2018-12-11 09:17:13', '');
INSERT INTO `Comment` VALUES (1544520025670, 1544514743789, 82001, 1544497353863, '2018-12-11 09:20:25', '1');
INSERT INTO `Comment` VALUES (1544520033768, 1544520025670, 82001, 1544497353863, '2018-12-11 09:20:33', '');
INSERT INTO `Comment` VALUES (1544520037107, 1544520025670, 82001, 1544497353863, '2018-12-11 09:20:37', '');
INSERT INTO `Comment` VALUES (1544520040994, 1544520037107, 82001, 1544497353863, '2018-12-11 09:20:40', '');
INSERT INTO `Comment` VALUES (1544520078377, 0, 82001, 1544265482923, '2018-12-11 09:21:18', '');
INSERT INTO `Comment` VALUES (1544520083950, 1544520078377, 82001, 1544265482923, '2018-12-11 09:21:23', '');
INSERT INTO `Comment` VALUES (1544520088507, 1544520078377, 82001, 1544265482923, '2018-12-11 09:21:28', '');
INSERT INTO `Comment` VALUES (1544581157084, 1544514743789, 82001, 1544497353863, '2018-12-12 02:19:17', '111');
INSERT INTO `Comment` VALUES (1544581171474, 0, 82001, 1544497353863, '2018-12-12 02:19:31', '333');
INSERT INTO `Comment` VALUES (1544581181353, 1544581171474, 82001, 1544497353863, '2018-12-12 02:19:41', '444');
INSERT INTO `Comment` VALUES (1544581186743, 1544514743789, 82001, 1544497353863, '2018-12-12 02:19:46', '555');
INSERT INTO `Comment` VALUES (1544617314076, 0, 82001, 1544497355630, '2018-12-12 12:21:54', 'hubby');
INSERT INTO `Comment` VALUES (1544617322784, 1544514802708, 82001, 1544497355630, '2018-12-12 12:22:02', 'we see');
INSERT INTO `Comment` VALUES (1545102266463, 0, 82001, 1544497355630, '2018-12-18 03:04:26', '');
INSERT INTO `Comment` VALUES (1545209831932, 0, 82001, 1544537838100, '2018-12-19 08:57:11', '');
INSERT INTO `Comment` VALUES (1545527888416, 0, 82001, 1545508011343, '2018-12-23 01:18:08', 'hello');
INSERT INTO `Comment` VALUES (1545527898986, 1545527888416, 82001, 1545508011343, '2018-12-23 01:18:18', 'world');
INSERT INTO `Comment` VALUES (1545527923036, 1545527888416, 82001, 1545508011343, '2018-12-23 01:18:43', '');
INSERT INTO `Comment` VALUES (1545802151172, 0, 82001, 1545560428650, '2018-12-26 05:29:11', '');
INSERT INTO `Comment` VALUES (1545811395533, 1545802151172, 82001, 1545560428650, '2018-12-26 08:03:15', '');
INSERT INTO `Comment` VALUES (1545904207328, 1545802151172, 82001, 1545560428650, '2018-12-27 09:50:07', '');
INSERT INTO `Comment` VALUES (1545918307310, 0, 82001, 15, '2018-12-27 13:45:07', '');
INSERT INTO `Comment` VALUES (1545927001999, 1545895875719, 82001, 1545893190636, '2018-12-27 16:10:02', 'www');
INSERT INTO `Comment` VALUES (1545961973331, 0, 82001, 15, '2018-12-28 01:52:53', '');
INSERT INTO `Comment` VALUES (1546050359778, 0, 82001, 15, '2018-12-29 02:25:59', '');
INSERT INTO `Comment` VALUES (1546050386785, 0, 82001, 1516086423441, '2018-12-29 02:26:26', '');
INSERT INTO `Comment` VALUES (1546934031755, 0, 82001, 1544497355630, '2019-01-08 07:53:51', '+1');
INSERT INTO `Comment` VALUES (1546934145366, 0, 82001, 15, '2019-01-08 07:55:45', '');
INSERT INTO `Comment` VALUES (1546935903414, 0, 82001, 15, '2019-01-08 08:25:03', '');
INSERT INTO `Comment` VALUES (1546999088223, 0, 82001, 1546934384440, '2019-01-09 01:58:08', '');
INSERT INTO `Comment` VALUES (1547479596730, 0, 82001, 15, '2019-01-14 15:26:36', '');
INSERT INTO `Comment` VALUES (1547542463183, 1546999088223, 82001, 1546934384440, '2019-01-15 08:54:23', '');
INSERT INTO `Comment` VALUES (1547542491318, 0, 82001, 1547479596460, '2019-01-15 08:54:51', 'YY');
INSERT INTO `Comment` VALUES (1547549161954, 0, 82001, 1547479596460, '2019-01-15 10:46:01', 'Ggh');
INSERT INTO `Comment` VALUES (1547559759283, 0, 82002, 15, '2019-01-15 13:42:39', '');
INSERT INTO `Comment` VALUES (1547627710657, 0, 82001, 15, '2019-01-16 08:35:10', '');
INSERT INTO `Comment` VALUES (1547627714193, 0, 82001, 15, '2019-01-16 08:35:14', '');
INSERT INTO `Comment` VALUES (1547629888747, 0, 82002, 15, '2019-01-16 09:11:28', '');
INSERT INTO `Comment` VALUES (1547629914001, 0, 82001, 15, '2019-01-16 09:11:54', '');
INSERT INTO `Comment` VALUES (1547630122254, 0, 82001, 15, '2019-01-16 09:15:22', '');
INSERT INTO `Comment` VALUES (1547630243666, 0, 82001, 15, '2019-01-16 09:17:23', '');
INSERT INTO `Comment` VALUES (1547691041482, 0, 82001, 15, '2019-01-17 02:10:41', '');
INSERT INTO `Comment` VALUES (1547713184681, 0, 82001, 15, '2019-01-17 08:19:44', '');
INSERT INTO `Comment` VALUES (1547723265947, 0, 82001, 15, '2019-01-17 11:07:45', '');
INSERT INTO `Comment` VALUES (1547782483094, 0, 82001, 15, '2019-01-18 03:34:43', '');
INSERT INTO `Comment` VALUES (1547783370682, 0, 82001, 15, '2019-01-18 03:49:30', '');
INSERT INTO `Comment` VALUES (1547889930890, 0, 82001, 1544276121218, '2019-01-19 09:25:30', '@');
INSERT INTO `Comment` VALUES (1547975064126, 0, 82001, 15, '2019-01-20 09:04:24', '');
INSERT INTO `Comment` VALUES (1548118482563, 1547542463183, 82001, 1546934384440, '2019-01-22 00:54:42', '');
INSERT INTO `Comment` VALUES (1548138917327, 0, 82001, 1545560428650, '2019-01-22 06:35:17', '');
INSERT INTO `Comment` VALUES (1548382620695, 0, 82001, 15, '2019-01-25 02:17:00', '');
INSERT INTO `Comment` VALUES (1548599385881, 0, 82001, 1548599375288, '2019-01-27 14:29:45', '');
INSERT INTO `Comment` VALUES (1548643322337, 0, 82001, 15, '2019-01-28 02:42:02', '');
INSERT INTO `Comment` VALUES (1548653580883, 1548599385881, 82001, 1548599375288, '2019-01-28 05:33:00', '');
INSERT INTO `Comment` VALUES (1548728775182, 0, 82001, 15, '2019-01-29 02:26:15', '');
INSERT INTO `Comment` VALUES (1548822634508, 0, 82002, 15, '2019-01-30 04:30:34', '');
INSERT INTO `Comment` VALUES (1548822671709, 0, 82001, 15, '2019-01-30 04:31:11', '');
INSERT INTO `Comment` VALUES (1548828580032, 1548653580883, 82001, 1548599375288, '2019-01-30 06:09:40', '');
INSERT INTO `Comment` VALUES (1548828610840, 0, 82001, 1545819752556, '2019-01-30 06:10:10', '');
INSERT INTO `Comment` VALUES (1549549983638, 0, 82001, 15, '2019-02-07 14:33:11', '');
COMMIT;
-- ----------------------------
-- Table structure for Document
-- ----------------------------
DROP TABLE IF EXISTS `Document`;
CREATE TABLE `Document` (
`id` bigint(15) NOT NULL COMMENT '',
`userId` bigint(15) NOT NULL COMMENT 'id\nadminId\nAdmin',
`version` tinyint(4) NOT NULL DEFAULT '2' COMMENT '\n0 - ',
`name` varchar(100) NOT NULL COMMENT '',
`url` varchar(250) NOT NULL COMMENT '',
`request` text NOT NULL COMMENT '\njson',
`response` text COMMENT 'JSON\njson',
`date` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='\n/';
-- ----------------------------
-- Records of Document
-- ----------------------------
BEGIN;
INSERT INTO `Document` VALUES (1, 0, 1, '', '/login', '{\"type\": 0, \"phone\": \"13000082001\", \"version\": 1, \"password\": \"123456\"}', NULL, '2017-11-26 07:35:19');
INSERT INTO `Document` VALUES (2, 0, 1, '(type:1)', '/register', '{\n \"Privacy\": {\n \"phone\": \"13000083333\",\n \"_password\": \"123456\"\n },\n \"User\": {\n \"name\": \"APIJSONUser\"\n },\n \"verify\": \"6840\"\n}', '{\"code\":412,\"msg\":\"\"}', '2017-11-26 06:56:10');
INSERT INTO `Document` VALUES (3, 0, 1, '', '/logout', '{}', NULL, '2017-11-26 09:36:10');
INSERT INTO `Document` VALUES (1511689914598, 0, 1, '', '/gets', '{\"tag\": \"Privacy\", \"Privacy\": {\"id\": 82001}}', '{\"Privacy\":{\"id\":82001,\"more\":true,\"certified\":1,\"phone\":13000082001,\"balance\":9835.11},\"code\":200,\"msg\":\"success\"}', '2017-11-26 09:51:54');
INSERT INTO `Document` VALUES (1511796155276, 0, 1, '', '/post/verify', '{\"type\": 0, \"phone\": \"13000082001\"}', '{\"Verify\":{\"id\":1533396718012,\"type\":0,\"phone\":13000082001,\"verify\":4995,\"date\":\"2018-08-04 23:31:58.0\"},\"tag\":\"Verify\",\"code\":200,\"msg\":\"success\"}', '2017-11-27 15:22:35');
INSERT INTO `Document` VALUES (1511796208669, 0, 1, '', '/heads/verify', '{\"type\": 0, \"phone\": \"13000082001\"}', '{\"Verify\":{\"code\":200,\"msg\":\"success\",\"count\":1},\"code\":200,\"msg\":\"success\"}', '2017-11-27 15:23:28');
INSERT INTO `Document` VALUES (1511796589078, 0, 1, '(type:2)-+', '/put/password', '{\"verify\": \"10322\", \"Privacy\": {\"phone\": \"13000082001\", \"_password\": \"666666\"}}', '{\"code\":412,\"msg\":\"\"}', '2017-11-27 15:29:49');
INSERT INTO `Document` VALUES (1511796882183, 0, 1, '()/', '/put/balance', '{\"tag\": \"Privacy\", \"Privacy\": {\"id\": 82001, \"balance+\": 100.15, \"_payPassword\": \"123456\"}}', '{\"Privacy\":{\"code\":200,\"msg\":\"success\",\"id\":82001,\"count\":1},\"code\":200,\"msg\":\"success\"}', '2017-11-27 15:34:42');
INSERT INTO `Document` VALUES (1511963330794, 0, 2, '()-API', '/get', '{\n \"Document[]\": {\n \"Document\": {\n \"@role\": \"login\",\n \"@order\": \"version-,date-\"\n }\n }\n}', NULL, '2017-11-29 13:48:50');
INSERT INTO `Document` VALUES (1511963677324, 0, 1, '', '/get', '{\"User\": {\"id\": 82001}}', '{\"User\":{\"id\":82001,\"sex\":0,\"name\":\"\",\"tag\":\"APIJSON User\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\",\"contactIdList\":[82025,82024,82003,93793,70793],\"pictureList\":[\"http://common.cnblogs.com/images/icon_weibo_24.png\"],\"date\":\"2017-02-01 19:21:50.0\"},\"code\":200,\"msg\":\"success\"}', '2017-11-29 13:54:37');
INSERT INTO `Document` VALUES (1511963722969, 0, 1, '(\"id{}\":contactIdList)-', '/get', '{\n \"User[]\": {\n \"count\": 10,\n \"page\": 0,\n \"User\": {\n \"@column\": \"id,sex,name,tag,head\",\n \"@order\": \"name+\",\n \"id{}\": [\n 82002,\n 82004,\n 70793\n ]\n }\n }\n}', '{\"User[]\":[{\"id\":82002,\"sex\":1,\"name\":\"Happy~\",\"tag\":\"iOS\",\"head\":\"http://static.oschina.net/uploads/user/1174/2348263_50.png?t=1439773471000\"},{\"id\":70793,\"sex\":0,\"name\":\"Strong\",\"tag\":\"djdj\",\"head\":\"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\"},{\"id\":82004,\"sex\":0,\"name\":\"Tommy\",\"tag\":\"fasef\",\"head\":\"http://static.oschina.net/uploads/user/1200/2400261_50.png?t=1439638750000\"}],\"code\":200,\"msg\":\"success\"}', '2017-11-29 13:55:22');
INSERT INTO `Document` VALUES (1511963990071, 0, 1, 'Moment+User+praiseUserList', '/get', '{\n \"Moment\": {\n \"id\": 15\n },\n \"User\": {\n \"id@\": \"Moment/userId\",\n \"@column\": \"id,name,head\"\n },\n \"User[]\": {\n \"count\": 10,\n \"User\": {\n \"id{}@\": \"Moment/praiseUserIdList\",\n \"@column\": \"id,name\"\n }\n }\n}', '{\"Moment\":{\"id\":15,\"userId\":70793,\"date\":\"2017-02-08 16:06:11.0\",\"content\":\"APIJSONisaJSONTransmissionStructureProtocol\",\"praiseUserIdList\":[82055,82002,38710],\"pictureList\":[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"http://common.cnblogs.com/images/icon_weibo_24.png\"]},\"User\":{\"id\":70793,\"name\":\"Strong\",\"head\":\"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\"},\"User[]\":[{\"id\":38710,\"name\":\"TommyLemon\"},{\"id\":82002,\"name\":\"Happy~\"},{\"id\":82055,\"name\":\"Solid\"}],\"code\":200,\"msg\":\"success\"}', '2017-11-29 13:59:50');
INSERT INTO `Document` VALUES (1511964176688, 0, 1, '-Comment+User', '/get', '{\n \"[]\": {\n \"count\": 20,\n \"page\": 0,\n \"Comment\": {\n \"@order\": \"date+\",\n \"momentId\": 15\n },\n \"User\": {\n \"id@\": \"/Comment/userId\",\n \"@column\": \"id,name,head\"\n }\n }\n}', '{\"[]\":[{\"Comment\":{\"id\":176,\"toId\":166,\"userId\":38710,\"momentId\":15,\"date\":\"2017-03-25 20:28:03.0\",\"content\":\"thank you\"},\"User\":{\"id\":38710,\"name\":\"TommyLemon\",\"head\":\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\"}},{\"Comment\":{\"id\":1490863469638,\"toId\":0,\"userId\":82002,\"momentId\":15,\"date\":\"2017-03-30 16:44:29.0\",\"content\":\"Just do it\"},\"User\":{\"id\":82002,\"name\":\"Happy~\",\"head\":\"http://static.oschina.net/uploads/user/1174/2348263_50.png?t=1439773471000\"}},{\"Comment\":{\"id\":1490875660259,\"toId\":1490863469638,\"userId\":82055,\"momentId\":15,\"date\":\"2017-03-30 20:07:40.0\",\"content\":\"I prove wht you said(??????)\"},\"User\":{\"id\":82055,\"name\":\"Solid\",\"head\":\"http://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1508227456407,\"toId\":0,\"userId\":82001,\"momentId\":15,\"date\":\"2017-10-17 16:04:16.0\",\"content\":\"hsh\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1509346606036,\"toId\":0,\"userId\":82001,\"momentId\":15,\"date\":\"2017-10-30 14:56:46.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1525933255901,\"userId\":82001,\"momentId\":15,\"date\":\"2018-05-10 14:20:55.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1527949266037,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-02 22:21:06.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1528339777338,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-07 10:49:37.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1528366915282,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-07 18:21:55.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1528366931410,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-07 18:22:11.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1528392773597,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-08 01:32:53.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529034360708,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-15 11:46:00.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529078537044,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-16 00:02:17.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529401004622,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-19 17:36:44.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529401505690,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-19 17:45:05.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529468113356,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-20 12:15:13.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529724026842,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-23 11:20:26.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1529909214303,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-25 14:46:54.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1530276831779,\"userId\":82001,\"momentId\":15,\"date\":\"2018-06-29 20:53:51.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}},{\"Comment\":{\"id\":1531365764793,\"userId\":82001,\"momentId\":15,\"date\":\"2018-07-12 11:22:44.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\"}}],\"code\":200,\"msg\":\"success\"}', '2017-11-29 14:02:56');
INSERT INTO `Document` VALUES (1511967853339, 0, 1, 'Moment+User+User:parise[]+Comment[]', '/get', '{ \"[]\": { \"count\": 5, \"page\": 0, \"Moment\": { \"@order\": \"date+\" }, \"User\": { \"id@\": \"/Moment/userId\", \"@column\": \"id,name,head\" }, \"User[]\": { \"count\": 10, \"User\": { \"id{}@\": \"[]/Moment/praiseUserIdList\", \"@column\": \"id,name\" } }, \"[]\": { \"count\": 6, \"Comment\": { \"@order\": \"date+\", \"momentId@\": \"[]/Moment/id\" }, \"User\": { \"id@\": \"/Comment/userId\", \"@column\": \"id,name\" } } } }', '{\"[]\":[{\"Moment\":{\"id\":301,\"userId\":93793,\"date\":\"2017-02-01 19:14:31.0\",\"content\":\"This is a Content...-301\",\"praiseUserIdList\":[38710,93793,82003,82005,82040,82055,82002,82001],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg\"]},\"User\":{\"id\":93793,\"name\":\"Mike\",\"head\":\"http://static.oschina.net/uploads/user/48/96331_50.jpg\"},\"User[]\":[{\"id\":38710,\"name\":\"TommyLemon\"},{\"id\":82001,\"name\":\"\"},{\"id\":82002,\"name\":\"Happy~\"},{\"id\":82003,\"name\":\"Wechat\"},{\"id\":82005,\"name\":\"Jan\"},{\"id\":82040,\"name\":\"Dream\"},{\"id\":82055,\"name\":\"Solid\"},{\"id\":93793,\"name\":\"Mike\"}],\"[]\":[{\"Comment\":{\"id\":45,\"toId\":0,\"userId\":93793,\"momentId\":301,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-45\"},\"User\":{\"id\":93793,\"name\":\"Mike\"}},{\"Comment\":{\"id\":51,\"toId\":45,\"userId\":82003,\"momentId\":301,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-51\"},\"User\":{\"id\":82003,\"name\":\"Wechat\"}},{\"Comment\":{\"id\":76,\"toId\":45,\"userId\":93793,\"momentId\":301,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-76\"},\"User\":{\"id\":93793,\"name\":\"Mike\"}},{\"Comment\":{\"id\":120,\"toId\":0,\"userId\":93793,\"momentId\":301,\"date\":\"2017-03-02 13:56:06.0\",\"content\":\"This is a Content...-110\"},\"User\":{\"id\":93793,\"name\":\"Mike\"}},{\"Comment\":{\"id\":124,\"toId\":0,\"userId\":82001,\"momentId\":301,\"date\":\"2017-03-02 13:56:06.0\",\"content\":\"This is a Content...-114\"},\"User\":{\"id\":82001,\"name\":\"\"}},{\"Comment\":{\"id\":1490781009548,\"toId\":51,\"userId\":82001,\"momentId\":301,\"date\":\"2017-03-29 17:50:09.0\",\"content\":\"3\"},\"User\":{\"id\":82001,\"name\":\"\"}}]},{\"Moment\":{\"id\":58,\"userId\":90814,\"date\":\"2017-02-01 19:14:31.0\",\"content\":\"This is a Content...-435\",\"praiseUserIdList\":[38710,82003,82005,93793,82006,82044,82001],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172507_aMmH.jpg\"]},\"User\":{\"id\":90814,\"name\":\"007\",\"head\":\"http://static.oschina.net/uploads/user/51/102723_50.jpg?t=1449212504000\"},\"User[]\":[{\"id\":38710,\"name\":\"TommyLemon\"},{\"id\":82001,\"name\":\"\"},{\"id\":82003,\"name\":\"Wechat\"},{\"id\":82005,\"name\":\"Jan\"},{\"id\":82006,\"name\":\"Meria\"},{\"id\":82044,\"name\":\"Love\"},{\"id\":93793,\"name\":\"Mike\"}],\"[]\":[{\"Comment\":{\"id\":13,\"toId\":0,\"userId\":82005,\"momentId\":58,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-13\"},\"User\":{\"id\":82005,\"name\":\"Jan\"}},{\"Comment\":{\"id\":77,\"toId\":13,\"userId\":93793,\"momentId\":58,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-77\"},\"User\":{\"id\":93793,\"name\":\"Mike\"}},{\"Comment\":{\"id\":97,\"toId\":13,\"userId\":82006,\"momentId\":58,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-97\"},\"User\":{\"id\":82006,\"name\":\"Meria\"}},{\"Comment\":{\"id\":167,\"userId\":82001,\"momentId\":58,\"date\":\"2017-03-25 19:48:41.0\",\"content\":\"Nice!\"},\"User\":{\"id\":82001,\"name\":\"\"}},{\"Comment\":{\"id\":173,\"userId\":38710,\"momentId\":58,\"date\":\"2017-03-25 20:25:13.0\",\"content\":\"Good\"},\"User\":{\"id\":38710,\"name\":\"TommyLemon\"}},{\"Comment\":{\"id\":188,\"toId\":97,\"userId\":82001,\"momentId\":58,\"date\":\"2017-03-26 15:21:32.0\",\"content\":\"1646\"},\"User\":{\"id\":82001,\"name\":\"\"}}]},{\"Moment\":{\"id\":371,\"userId\":82002,\"date\":\"2017-02-01 19:14:31.0\",\"content\":\"This is a Content...-371\",\"praiseUserIdList\":[90814,93793,82003,82005,82006,82040,82002,82001],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg\",\"http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg\",\"https://camo.githubusercontent.com/c98b1c86af136745cc4626c6ece830f76de9ee83/687474703a2f2f696d61676573323031352e636e626c6f67732e636f6d2f626c6f672f3636303036372f3230313630342f3636303036372d32303136303431343232343930383036362d313837323233393236352e6a7067\",\"http://static.oschina.net/uploads/img/201604/22172507_aMmH.jpg\",\"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg\"]},\"User\":{\"id\":82002,\"name\":\"Happy~\",\"head\":\"http://static.oschina.net/uploads/user/1174/2348263_50.png?t=1439773471000\"},\"User[]\":[{\"id\":82001,\"name\":\"\"},{\"id\":82002,\"name\":\"Happy~\"},{\"id\":82003,\"name\":\"Wechat\"},{\"id\":82005,\"name\":\"Jan\"},{\"id\":82006,\"name\":\"Meria\"},{\"id\":82040,\"name\":\"Dream\"},{\"id\":90814,\"name\":\"007\"},{\"id\":93793,\"name\":\"Mike\"}],\"[]\":[{\"Comment\":{\"id\":68,\"toId\":0,\"userId\":82005,\"momentId\":371,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-68\"},\"User\":{\"id\":82005,\"name\":\"Jan\"}},{\"Comment\":{\"id\":157,\"userId\":93793,\"momentId\":371,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-157\"},\"User\":{\"id\":93793,\"name\":\"Mike\"}},{\"Comment\":{\"id\":110,\"toId\":0,\"userId\":93793,\"momentId\":371,\"date\":\"2017-02-01 19:23:24.0\",\"content\":\"This is a Content...-110\"},\"User\":{\"id\":93793,\"name\":\"Mike\"}},{\"Comment\":{\"id\":114,\"toId\":0,\"userId\":82001,\"momentId\":371,\"date\":\"2017-03-02 13:56:06.0\",\"content\":\"This is a Content...-114\"},\"User\":{\"id\":82001,\"name\":\"\"}},{\"Comment\":{\"id\":115,\"toId\":0,\"userId\":38710,\"momentId\":371,\"date\":\"2017-03-02 13:56:06.0\",\"content\":\"This is a Content...-115\"},\"User\":{\"id\":38710,\"name\":\"TommyLemon\"}},{\"Comment\":{\"id\":116,\"toId\":0,\"userId\":70793,\"momentId\":371,\"date\":\"2017-03-02 13:56:06.0\",\"content\":\"This is a Content...-116\"},\"User\":{\"id\":70793,\"name\":\"Strong\"}}]},{\"Moment\":{\"id\":170,\"userId\":70793,\"date\":\"2017-02-01 19:14:31.0\",\"content\":\"This is a Content...-73\",\"praiseUserIdList\":[82044,82002,82001],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg\",\"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg\",\"http://static.oschina.net/uploads/img/201604/22172508_mpwj.jpg\"]},\"User\":{\"id\":70793,\"name\":\"Strong\",\"head\":\"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\"},\"User[]\":[{\"id\":82001,\"name\":\"\"},{\"id\":82002,\"name\":\"Happy~\"},{\"id\":82044,\"name\":\"Love\"}],\"[]\":[{\"Comment\":{\"id\":44,\"toId\":0,\"userId\":82003,\"momentId\":170,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-44\"},\"User\":{\"id\":82003,\"name\":\"Wechat\"}},{\"Comment\":{\"id\":54,\"toId\":0,\"userId\":82004,\"momentId\":170,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-54\"},\"User\":{\"id\":82004,\"name\":\"Tommy\"}},{\"Comment\":{\"id\":99,\"toId\":44,\"userId\":70793,\"momentId\":170,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-99\"},\"User\":{\"id\":70793,\"name\":\"Strong\"}},{\"Comment\":{\"id\":206,\"toId\":54,\"userId\":82001,\"momentId\":170,\"date\":\"2017-03-29 11:04:23.0\",\"content\":\"ejej\"},\"User\":{\"id\":82001,\"name\":\"\"}},{\"Comment\":{\"id\":1490780759866,\"toId\":99,\"userId\":82001,\"momentId\":170,\"date\":\"2017-03-29 17:45:59.0\",\"content\":\"99\"},\"User\":{\"id\":82001,\"name\":\"\"}},{\"Comment\":{\"id\":1490863661426,\"toId\":1490780759866,\"userId\":70793,\"momentId\":170,\"date\":\"2017-03-30 16:47:41.0\",\"content\":\"66\"},\"User\":{\"id\":70793,\"name\":\"Strong\"}}]},{\"Moment\":{\"id\":470,\"userId\":38710,\"date\":\"2017-02-01 19:14:31.0\",\"content\":\"This is a Content...-470\",\"praiseUserIdList\":[82001],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172507_Pz9Y.png\"]},\"User\":{\"id\":38710,\"name\":\"TommyLemon\",\"head\":\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\"},\"User[]\":[{\"id\":82001,\"name\":\"\"}],\"[]\":[{\"Comment\":{\"id\":4,\"toId\":0,\"userId\":38710,\"momentId\":470,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-4\"},\"User\":{\"id\":38710,\"name\":\"TommyLemon\"}},{\"Comment\":{\"id\":22,\"toId\":221,\"userId\":82001,\"momentId\":470,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"\"},\"User\":{\"id\":82001,\"name\":\"\"}},{\"Comment\":{\"id\":47,\"toId\":4,\"userId\":70793,\"momentId\":470,\"date\":\"2017-02-01 19:20:50.0\",\"content\":\"This is a Content...-47\"},\"User\":{\"id\":70793,\"name\":\"Strong\"}},{\"Comment\":{\"id\":1490863507114,\"toId\":4,\"userId\":82003,\"momentId\":470,\"date\":\"2017-03-30 16:45:07.0\",\"content\":\"yes\"},\"User\":{\"id\":82003,\"name\":\"Wechat\"}},{\"Comment\":{\"id\":1490863903900,\"toId\":0,\"userId\":82006,\"momentId\":470,\"date\":\"2017-03-30 16:51:43.0\",\"content\":\"SOGA\"},\"User\":{\"id\":82006,\"name\":\"Meria\"}},{\"Comment\":{\"id\":1491740899179,\"toId\":0,\"userId\":82001,\"momentId\":470,\"date\":\"2017-04-09 20:28:19.0\",\"content\":\"www\"},\"User\":{\"id\":82001,\"name\":\"\"}}]}],\"code\":200,\"msg\":\"success\"}', '2017-11-29 15:04:13');
INSERT INTO `Document` VALUES (1511969181103, 0, 1, '', '/put', '{\n \"User\": {\n \"id\": 82001,\n \"contactIdList+\": [93793]\n },\n \"tag\": \"User\"\n}', '{\"User\":{\"id\":82001,\"contactIdList+\":[93793],\"@role\":\"owner\"},\"code\":409,\"msg\":\"PUT User, contactIdList:93793 \"}', '2017-11-29 15:26:21');
INSERT INTO `Document` VALUES (1511969417632, 0, 1, '/', '/put', '{\n \"Moment\": {\n \"id\": 15,\n \"praiseUserIdList-\": [\n 82001\n ]\n },\n \"tag\": \"Moment\"\n}', '{\"Moment\":{\"code\":200,\"msg\":\"success\",\"id\":15,\"count\":1},\"code\":200,\"msg\":\"success\"}', '2017-11-29 15:30:17');
INSERT INTO `Document` VALUES (1511969630371, 0, 1, '', '/post', '{ \"Comment\": { \"momentId\": 15, \"content\": \"\" }, \"tag\": \"Comment\" }', '{\"Comment\":{\"code\":200,\"msg\":\"success\",\"id\":1533140610714,\"count\":1},\"code\":200,\"msg\":\"success\"}', '2017-11-29 15:33:50');
INSERT INTO `Document` VALUES (1511970009071, 0, 1, '', '/post', '{ \"Moment\": { \"content\": \"\", \"pictureList\": [\"http://static.oschina.net/uploads/user/48/96331_50.jpg\" ] }, \"tag\": \"Moment\" }', '{\"Moment\":{\"code\":200,\"msg\":\"success\",\"id\":1533140610716,\"count\":1},\"code\":200,\"msg\":\"success\"}', '2017-11-29 15:40:09');
INSERT INTO `Document` VALUES (1511970224332, 0, 1, '', '/put', '{\r \"User\": {\r \"id\": 82001,\r \"name\": \"\"\r },\r \"tag\": \"User\"\r }', '{\"User\":{\"code\":200,\"msg\":\"success\",\"id\":82001,\"count\":1},\"code\":200,\"msg\":\"success\"}', '2017-11-29 15:43:44');
INSERT INTO `Document` VALUES (1512216131854, 0, 1, '()-', '/get', '{\n \"[]\": {\n \"Table\": {\n \"TABLE_SCHEMA\": \"sys\",\n \"TABLE_TYPE\": \"BASE TABLE\",\n \"TABLE_NAME!$\": [\n \"\\\\_%\",\n \"sys\\\\_%\",\n \"system\\\\_%\"\n ],\n \"@order\": \"TABLE_NAME+\",\n \"@column\": \"TABLE_NAME,TABLE_COMMENT\"\n },\n \"Column[]\": {\n \"Column\": {\n \"TABLE_NAME@\": \"[]/Table/TABLE_NAME\",\n \"@column\": \"COLUMN_NAME,COLUMN_TYPE,IS_NULLABLE,COLUMN_COMMENT\"\n }\n }\n },\n \"Request[]\": {\n \"Request\": {\n \"@order\": \"version-,method-\"\n }\n }\n}', NULL, '2017-12-02 12:02:11');
INSERT INTO `Document` VALUES (1521901518764, 0, 2, '(): pictureList0', '/get', '{ \"User\": { \"id\": 38710, \"@position\": 0, \"firstPicture()\": \"getFromArray(pictureList,@position)\" } }', '{\"User\":{\"id\":38710,\"sex\":0,\"name\":\"TommyLemon\",\"tag\":\"Android&Java\",\"head\":\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"contactIdList\":[82003,82005,90814,82004,82009,82002,82044,93793,70793],\"pictureList\":[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"http://common.cnblogs.com/images/icon_weibo_24.png\"],\"date\":\"2017-02-01 19:21:50.0\",\"@position\":0,\"firstPicture\":\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\"},\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:25:18');
INSERT INTO `Document` VALUES (1521901610783, 0, 2, '(): userIdid>=100 Moment', '/get', '{\"[]\":{\"count\":10,\"Moment\":{\"@column\":\"userId;max(id):maxId\",\"@group\":\"userId\",\"@having\":\"maxId>=100\"}}}', '{\"[]\":[{\"Moment\":{\"userId\":38710,\"maxId\":1537025707417}},{\"Moment\":{\"userId\":70793,\"maxId\":551}},{\"Moment\":{\"userId\":82001,\"maxId\":1537025634931}},{\"Moment\":{\"userId\":82002,\"maxId\":1531062713966}},{\"Moment\":{\"userId\":82003,\"maxId\":1536805585275}},{\"Moment\":{\"userId\":82045,\"maxId\":1508073178489}},{\"Moment\":{\"userId\":82056,\"maxId\":1514858533480}},{\"Moment\":{\"userId\":93793,\"maxId\":1516086423441}},{\"Moment\":{\"userId\":1520242280259,\"maxId\":1520242333325}},{\"Moment\":{\"userId\":1523626157302,\"maxId\":1523936332614}}],\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:26:50');
INSERT INTO `Document` VALUES (1521901682845, 0, 2, '(): userIdMoment', '/get', '{\"[]\":{\"count\":10,\"Moment\":{\"@column\":\"userId,id\",\"@group\":\"userId,id\"}}}', '{\"[]\":[{\"Moment\":{\"userId\":38710,\"id\":235}},{\"Moment\":{\"userId\":38710,\"id\":470}},{\"Moment\":{\"userId\":38710,\"id\":511}},{\"Moment\":{\"userId\":38710,\"id\":595}},{\"Moment\":{\"userId\":38710,\"id\":704}},{\"Moment\":{\"userId\":38710,\"id\":1491200468898}},{\"Moment\":{\"userId\":38710,\"id\":1493835799335}},{\"Moment\":{\"userId\":38710,\"id\":1512314438990}},{\"Moment\":{\"userId\":38710,\"id\":1513094436910}},{\"Moment\":{\"userId\":38710,\"id\":1537025625613}}],\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:28:02');
INSERT INTO `Document` VALUES (1521901746808, 0, 2, '(): nameid User', '/get', '{\"[]\":{\"count\":10,\"User\":{\"@column\":\"name,id\",\"@order\":\"name-,id\"}}}', '{\"[]\":[{\"User\":{\"name\":\"\",\"id\":1508072071492}},{\"User\":{\"name\":\"\",\"id\":82001}},{\"User\":{\"name\":\"\",\"id\":1528264711016}},{\"User\":{\"name\":\"\",\"id\":1532188114543}},{\"User\":{\"name\":\"\",\"id\":1508072160401}},{\"User\":{\"name\":\"\",\"id\":1524042900591}},{\"User\":{\"name\":\"\",\"id\":1508072105320}},{\"User\":{\"name\":\"\",\"id\":1508072202871}},{\"User\":{\"name\":\"\",\"id\":1499057230629}},{\"User\":{\"name\":\"Yong\",\"id\":82027}}],\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:29:06');
INSERT INTO `Document` VALUES (1521901787202, 0, 2, '(): id,sex,name', '/get', '{\"User\":{\"@column\":\"id,sex,name\",\"id\":38710}}', '{\"User\":{\"id\":38710,\"sex\":0,\"name\":\"TommyLemon\"},\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:29:47');
INSERT INTO `Document` VALUES (1521902033331, 0, 2, '(): UserUser', '/get', '{\"[]\":{\"query\":2,\"count\":5,\"User\":{}},\"total@\":\"/[]/total\"}', '{\"[]\":[{\"User\":{\"id\":38710,\"sex\":0,\"name\":\"TommyLemon\",\"tag\":\"Android&Java\",\"head\":\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"contactIdList\":[82003,82005,90814,82004,82009,82002,82044,93793,70793],\"pictureList\":[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"http://common.cnblogs.com/images/icon_weibo_24.png\"],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":70793,\"sex\":0,\"name\":\"Strong\",\"tag\":\"djdj\",\"head\":\"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\",\"contactIdList\":[38710,82002],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg\",\"http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg\",\"https://camo.githubusercontent.com/788c0a7e11a\",\"https://camo.githubusercontent.com/f513f67\"],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82001,\"sex\":0,\"name\":\"\",\"tag\":\"APIJSON User\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\",\"contactIdList\":[82025,82024,82003,93793,82012,82028,82021,82006,82030,82035],\"pictureList\":[\"http://common.cnblogs.com/images/icon_weibo_24.png\"],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82002,\"sex\":1,\"name\":\"Happy~\",\"tag\":\"iOS\",\"head\":\"http://static.oschina.net/uploads/user/1174/2348263_50.png?t=1439773471000\",\"contactIdList\":[82005,82001,38710],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82003,\"sex\":1,\"name\":\"Wechat\",\"head\":\"http://common.cnblogs.com/images/wechat.png\",\"contactIdList\":[82001,93793],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}}],\"total\":121,\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:33:53');
INSERT INTO `Document` VALUES (1521902069870, 0, 2, '(): 3User5', '/get', '{\"[]\":{\"count\":5,\"page\":3,\"User\":{}}}', '{\"[]\":[{\"User\":{\"id\":82025,\"sex\":1,\"name\":\"Tommy\",\"head\":\"http://static.oschina.net/uploads/user/629/1258821_50.jpg?t=1378063141000\",\"contactIdList\":[],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82026,\"sex\":0,\"name\":\"iOS\",\"head\":\"http://static.oschina.net/uploads/user/1200/2400261_50.png?t=1439638750000\",\"contactIdList\":[],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82027,\"sex\":0,\"name\":\"Yong\",\"head\":\"http://my.oschina.net/img/portrait.gif?t=1451961935000\",\"contactIdList\":[],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82028,\"sex\":1,\"name\":\"gaeg\",\"head\":\"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\",\"contactIdList\":[],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82029,\"sex\":0,\"name\":\"GASG\",\"head\":\"http://common.cnblogs.com/images/wechat.png\",\"contactIdList\":[],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}}],\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:34:29');
INSERT INTO `Document` VALUES (1521902110679, 0, 2, '(): User5', '/get', '{\"[]\":{\"count\":5,\"User\":{}}}', '{\"[]\":[{\"User\":{\"id\":38710,\"sex\":0,\"name\":\"TommyLemon\",\"tag\":\"Android&Java\",\"head\":\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"contactIdList\":[82003,82005,90814,82004,82009,82002,82044,93793,70793],\"pictureList\":[\"http://static.oschina.net/uploads/user/1218/2437072_100.jpg?t=1461076033000\",\"http://common.cnblogs.com/images/icon_weibo_24.png\"],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":70793,\"sex\":0,\"name\":\"Strong\",\"tag\":\"djdj\",\"head\":\"http://static.oschina.net/uploads/user/585/1170143_50.jpg?t=1390226446000\",\"contactIdList\":[38710,82002],\"pictureList\":[\"http://static.oschina.net/uploads/img/201604/22172508_eGDi.jpg\",\"http://static.oschina.net/uploads/img/201604/22172507_rrZ5.jpg\",\"https://camo.githubusercontent.com/788c0a7e11a\",\"https://camo.githubusercontent.com/f513f67\"],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82001,\"sex\":0,\"name\":\"\",\"tag\":\"APIJSON User\",\"head\":\"https://static.oschina.net/uploads/user/19/39085_50.jpg\",\"contactIdList\":[82025,82024,82003,93793,82012,82028,82021,82006,82030,82035],\"pictureList\":[\"http://common.cnblogs.com/images/icon_weibo_24.png\"],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82002,\"sex\":1,\"name\":\"Happy~\",\"tag\":\"iOS\",\"head\":\"http://static.oschina.net/uploads/user/1174/2348263_50.png?t=1439773471000\",\"contactIdList\":[82005,82001,38710],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}},{\"User\":{\"id\":82003,\"sex\":1,\"name\":\"Wechat\",\"head\":\"http://common.cnblogs.com/images/wechat.png\",\"contactIdList\":[82001,93793],\"pictureList\":[],\"date\":\"2017-02-01 19:21:50.0\"}}],\"code\":200,\"msg\":\"success\"}', '2018-03-24 14:35:10');
INSERT INTO `Document` VALUES (1521903761688, 0, 2, '(): ! ', '/head', '{\"User\":{\"id!{}\":[82001,38710]}}', '{\"User\":{\"code\":200,\"msg\":\"success\",\"count\":119},\"code\":200,\"msg\":\"success\"}', '2018-03-24 15:02:41');
INSERT INTO `Document` VALUES (1521903828409, 0, 2, '(): | ', '/head', '{\"User\":{\"id|{}\":\">90000,80000,=1,=1,={version}\"},{\"COLUMN_NAME\":\"method\",\"COLUMN_TYPE\":\"varchar(10)\",\"IS_NULLABLE\":\"YES\",\"COLUMN_COMMENT\":\"GET,HEAD\"},{\"COLUMN_NAME\":\"tag\",\"COLUMN_TYPE\":\"varchar(20)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"structure\",\"COLUMN_TYPE\":\"json\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"detail\",\"COLUMN_TYPE\":\"varchar(10000)\",\"IS_NULLABLE\":\"YES\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"date\",\"COLUMN_TYPE\":\"timestamp\",\"IS_NULLABLE\":\"YES\",\"COLUMN_COMMENT\":\"\"}]},{\"Table\":{\"TABLE_NAME\":\"Response\",\"TABLE_COMMENT\":\"\"},\"Column[]\":[{\"COLUMN_NAME\":\"id\",\"COLUMN_TYPE\":\"bigint(15)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"method\",\"COLUMN_TYPE\":\"varchar(10)\",\"IS_NULLABLE\":\"YES\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"model\",\"COLUMN_TYPE\":\"varchar(20)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"tableSQL\"},{\"COLUMN_NAME\":\"structure\",\"COLUMN_TYPE\":\"json\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"detail\",\"COLUMN_TYPE\":\"varchar(10000)\",\"IS_NULLABLE\":\"YES\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"date\",\"COLUMN_TYPE\":\"timestamp\",\"IS_NULLABLE\":\"YES\",\"COLUMN_COMMENT\":\"\"}]},{\"Table\":{\"TABLE_NAME\":\"Test\",\"TABLE_COMMENT\":\" SELECT condition SELECT * FROM Test WHERE condition\"},\"Column[]\":[{\"COLUMN_NAME\":\"id\",\"COLUMN_TYPE\":\"tinyint(2)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"}]},{\"Table\":{\"TABLE_NAME\":\"TestRecord\",\"TABLE_COMMENT\":\"\n\"},\"Column[]\":[{\"COLUMN_NAME\":\"id\",\"COLUMN_TYPE\":\"bigint(15)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"userId\",\"COLUMN_TYPE\":\"bigint(15)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"id\"},{\"COLUMN_NAME\":\"documentId\",\"COLUMN_TYPE\":\"bigint(15)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"id\"},{\"COLUMN_NAME\":\"response\",\"COLUMN_TYPE\":\"text\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"JSON\"},{\"COLUMN_NAME\":\"date\",\"COLUMN_TYPE\":\"timestamp\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"}]},{\"Table\":{\"TABLE_NAME\":\"Verify\",\"TABLE_COMMENT\":\"\"},\"Column[]\":[{\"COLUMN_NAME\":\"id\",\"COLUMN_TYPE\":\"bigint(15)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"type\",\"COLUMN_TYPE\":\"int(2)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\n0-\n1-\n2-\n3-\"},{\"COLUMN_NAME\":\"phone\",\"COLUMN_TYPE\":\"bigint(11)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"verify\",\"COLUMN_TYPE\":\"int(6)\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"},{\"COLUMN_NAME\":\"date\",\"COLUMN_TYPE\":\"timestamp\",\"IS_NULLABLE\":\"NO\",\"COLUMN_COMMENT\":\"\"}]}],\"Request[]\":[{\"id\":36,\"version\":2,\"method\":\"PUT\",\"tag\":\"Document\",\"structure\":{\"ADD\":{\"@role\":\"owner\"},\"DISALLOW\":\"userId\",\"NECESSARY\":\"id\"},\"date\":\"2017-11-26 16:35:15.0\"},{\"id\":35,\"version\":2,\"method\":\"POST\",\"tag\":\"Document\",\"structure\":{\"DISALLOW\":\"id\",\"NECESSARY\":\"userId,name,url,request\"},\"date\":\"2017-11-26 16:34:41.0\"},{\"id\":32,\"version\":2,\"method\":\"GETS\",\"tag\":\"Privacy\",\"structure\":{\"ADD\":{\"@role\":\"owner\"},\"DISALLOW\":\"_password,_payPassword\",\"NECESSARY\":\"id\"},\"date\":\"2017-06-13 00:05:51.0\"},{\"id\":33,\"version\":2,\"method\":\"GETS\",\"tag\":\"Privacy-CIRCLE\",\"structure\":{\"Privacy\":{\"DISALLOW\":\"!\",\"NECESSARY\":\"id\",\"PUT\":{\"@column\":\"phone\",\"@role\":\"CIRCLE\"}}},\"date\":\"2017-06-13 00:05:51.0\"},{\"id\":37,\"version\":2,\"method\":\"DELETE\",\"tag\":\"Document\",\"structure\":{\"ADD\":{\"@role\":\"owner\"},\"DISALLOW\":\"!\",\"NECESSARY\":\"id\"},\"date\":\"2017-11-26 16:36:20.0\"},{\"id\":4,\"version\":1,\"method\":\"PUT\",\"tag\":\"User\",\"structure\":{\"ADD\":{\"@role\":\"owner\"},\"DISALLOW\":\"phone\",\"NECESSARY\":\"id\"},\"detail\":\"idphoneADD@roleowner\",\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":8,\"version\":1,\"method\":\"PUT\",\"tag\":\"User-phone\",\"structure\":{\"User\":{\"ADD\":{\"@role\":\"owner\"},\"DISALLOW\":\"!\",\"NECESSARY\":\"id,phone,_password\",\"PUT\":{\"@condition\":\"_password\"}}},\"detail\":\"! necessary\",\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":17,\"version\":1,\"method\":\"PUT\",\"tag\":\"Moment\",\"structure\":{\"DISALLOW\":\"userId,date\",\"NECESSARY\":\"id\"},\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":23,\"version\":1,\"method\":\"PUT\",\"tag\":\"Privacy\",\"structure\":{\"ADD\":{\"@role\":\"owner\"},\"NECESSARY\":\"id\"},\"detail\":\"ADD@roleowner\",\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":25,\"version\":1,\"method\":\"PUT\",\"tag\":\"Praise\",\"structure\":{\"NECESSARY\":\"id\"},\"detail\":\"id\",\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":27,\"version\":1,\"method\":\"PUT\",\"tag\":\"Comment[]\",\"structure\":{\"Comment\":{\"ADD\":{\"@role\":\"owner\"},\"NECESSARY\":\"id{}\"}},\"detail\":\"DISALLOWDELETE\",\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":28,\"version\":1,\"method\":\"PUT\",\"tag\":\"Comment\",\"structure\":{\"ADD\":{\"@role\":\"owner\"},\"NECESSARY\":\"id\"},\"detail\":\"CommenttagCommentParser.getCorrectRequest\",\"date\":\"2017-02-01 19:19:51.0\"},{\"id\":30,\"version\":1,\"method\":\"PUT\",\"tag\":\"balance+\",\"structure\":{\"Privacy\":{\"VERIFY\":{\"balance+&{}\":\">=1,=1=1, call ps_trace_statement_digest(\'891ec6860f98ba46d89dd20b0c03652c\', 10, 0.1, true, true);\n +--------------------+\n | SUMMARY STATISTICS |\n +--------------------+\n | SUMMARY STATISTICS |\n +--------------------+\n 1 row in set (9.11 sec)\n \n +------------+-----------+-----------+-----------+---------------+------------+------------+\n | executions | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scans |\n +------------+-----------+-----------+-----------+---------------+------------+------------+\n | 21 | 4.11 ms | 2.00 ms | 0 | 21 | 0 | 0 |\n +------------+-----------+-----------+-----------+---------------+------------+------------+\n 1 row in set (9.11 sec)\n \n +------------------------------------------+-------+-----------+\n | event_name | count | latency |\n +------------------------------------------+-------+-----------+\n | stage/sql/checking query cache for query | 16 | 724.37 us |\n | stage/sql/statistics | 16 | 546.92 us |\n | stage/sql/freeing items | 18 | 520.11 us |\n | stage/sql/init | 51 | 466.80 us |\n ...\n | stage/sql/cleaning up | 18 | 11.92 us |\n | stage/sql/executing | 16 | 6.95 us |\n +------------------------------------------+-------+-----------+\n 17 rows in set (9.12 sec)\n \n +---------------------------+\n | LONGEST RUNNING STATEMENT |\n +---------------------------+\n | LONGEST RUNNING STATEMENT |\n +---------------------------+\n 1 row in set (9.16 sec)\n \n +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n | thread_id | exec_time | lock_time | rows_sent | rows_examined | tmp_tables | full_scan |\n +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n | 166646 | 618.43 us | 1.00 ms | 0 | 1 | 0 | 0 |\n +-----------+-----------+-----------+-----------+---------------+------------+-----------+\n 1 row in set (9.16 sec)\n \n // Truncated for clarity...\n +-----------------------------------------------------------------+\n | sql_text |\n +-----------------------------------------------------------------+\n | select hibeventhe0_.id as id1382_, hibeventhe0_.createdTime ... |\n +-----------------------------------------------------------------+\n 1 row in set (9.17 sec)\n \n +------------------------------------------+-----------+\n | event_name | latency |\n +------------------------------------------+-----------+\n | stage/sql/init | 8.61 us |\n | stage/sql/Waiting for query cache lock | 453.23 us |\n | stage/sql/init | 331.07 ns |\n | stage/sql/checking query cache for query | 43.04 us |\n ...\n | stage/sql/freeing items | 30.46 us |\n | stage/sql/cleaning up | 662.13 ns |\n +------------------------------------------+-----------+\n 18 rows in set (9.23 sec)\n \n +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |\n +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n | 1 | SIMPLE | hibeventhe0_ | const | fixedTime | fixedTime | 775 | const,const | 1 | NULL |\n +----+-------------+--------------+-------+---------------+-----------+---------+-------------+------+-------+\n 1 row in set (9.27 sec)\n \n Query OK, 0 rows affected (9.28 sec)\n '
BEGIN DECLARE v_start_fresh BOOLEAN DEFAULT false; DECLARE v_auto_enable BOOLEAN DEFAULT false; DECLARE v_explain BOOLEAN DEFAULT true; DECLARE v_this_thread_enabed ENUM('YES', 'NO'); DECLARE v_runtime INT DEFAULT 0; DECLARE v_start INT DEFAULT 0; DECLARE v_found_stmts INT; SET @log_bin := @@sql_log_bin; SET sql_log_bin = 0; SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID(); CALL sys.ps_setup_disable_thread(CONNECTION_ID()); DROP TEMPORARY TABLE IF EXISTS stmt_trace; CREATE TEMPORARY TABLE stmt_trace ( thread_id BIGINT UNSIGNED, timer_start BIGINT UNSIGNED, event_id BIGINT UNSIGNED, sql_text longtext, timer_wait BIGINT UNSIGNED, lock_time BIGINT UNSIGNED, errors BIGINT UNSIGNED, mysql_errno INT, rows_sent BIGINT UNSIGNED, rows_affected BIGINT UNSIGNED, rows_examined BIGINT UNSIGNED, created_tmp_tables BIGINT UNSIGNED, created_tmp_disk_tables BIGINT UNSIGNED, no_index_used BIGINT UNSIGNED, PRIMARY KEY (thread_id, timer_start) ); DROP TEMPORARY TABLE IF EXISTS stmt_stages; CREATE TEMPORARY TABLE stmt_stages ( event_id BIGINT UNSIGNED, stmt_id BIGINT UNSIGNED, event_name VARCHAR(128), timer_wait BIGINT UNSIGNED, PRIMARY KEY (event_id) ); SET v_start_fresh = in_start_fresh; IF v_start_fresh THEN TRUNCATE TABLE performance_schema.events_statements_history_long; TRUNCATE TABLE performance_schema.events_stages_history_long; END IF; SET v_auto_enable = in_auto_enable; IF v_auto_enable THEN CALL sys.ps_setup_save(0); UPDATE performance_schema.threads SET INSTRUMENTED = IF(PROCESSLIST_ID IS NOT NULL, 'YES', 'NO'); UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME NOT LIKE '%\_history' AND NAME NOT LIKE 'events_wait%' AND NAME NOT LIKE 'events_transactions%' AND NAME 'statements_digest'; UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES' WHERE NAME LIKE 'statement/%' OR NAME LIKE 'stage/%'; END IF; WHILE v_runtime < in_runtime DO SELECT UNIX_TIMESTAMP() INTO v_start; INSERT IGNORE INTO stmt_trace SELECT thread_id, timer_start, event_id, sql_text, timer_wait, lock_time, errors, mysql_errno, rows_sent, rows_affected, rows_examined, created_tmp_tables, created_tmp_disk_tables, no_index_used FROM performance_schema.events_statements_history_long WHERE digest = in_digest; INSERT IGNORE INTO stmt_stages SELECT stages.event_id, stmt_trace.event_id, stages.event_name, stages.timer_wait FROM performance_schema.events_stages_history_long AS stages JOIN stmt_trace ON stages.nesting_event_id = stmt_trace.event_id; SELECT SLEEP(in_interval) INTO @sleep; SET v_runtime = v_runtime + (UNIX_TIMESTAMP() - v_start); END WHILE; SELECT "SUMMARY STATISTICS"; SELECT COUNT(*) executions, sys.format_time(SUM(timer_wait)) AS exec_time, sys.format_time(SUM(lock_time)) AS lock_time, SUM(rows_sent) AS rows_sent, SUM(rows_affected) AS rows_affected, SUM(rows_examined) AS rows_examined, SUM(created_tmp_tables) AS tmp_tables, SUM(no_index_used) AS full_scans FROM stmt_trace; SELECT event_name, COUNT(*) as count, sys.format_time(SUM(timer_wait)) as latency FROM stmt_stages GROUP BY event_name ORDER BY SUM(timer_wait) DESC; SELECT "LONGEST RUNNING STATEMENT"; SELECT thread_id, sys.format_time(timer_wait) AS exec_time, sys.format_time(lock_time) AS lock_time, rows_sent, rows_affected, rows_examined, created_tmp_tables AS tmp_tables, no_index_used AS full_scan FROM stmt_trace ORDER BY timer_wait DESC LIMIT 1; SELECT sql_text FROM stmt_trace ORDER BY timer_wait DESC LIMIT 1; SELECT sql_text, event_id INTO @sql, @sql_id FROM stmt_trace ORDER BY timer_wait DESC LIMIT 1; IF (@sql_id IS NOT NULL) THEN SELECT event_name, sys.format_time(timer_wait) as latency FROM stmt_stages WHERE stmt_id = @sql_id ORDER BY event_id; END IF; DROP TEMPORARY TABLE stmt_trace; DROP TEMPORARY TABLE stmt_stages; IF (@sql IS NOT NULL) THEN SET @stmt := CONCAT("EXPLAIN FORMAT=JSON ", @sql); BEGIN DECLARE CONTINUE HANDLER FOR 1064, 1146 SET v_explain = false; PREPARE explain_stmt FROM @stmt; END; IF (v_explain) THEN EXECUTE explain_stmt; DEALLOCATE PREPARE explain_stmt; END IF; END IF; IF v_auto_enable THEN CALL sys.ps_setup_reload_saved(); END IF; IF (v_this_thread_enabed = 'YES') THEN CALL sys.ps_setup_enable_thread(CONNECTION_ID()); END IF; SET sql_log_bin = @log_bin; END
;;
delimiter ;
-- ----------------------------
-- Procedure structure for ps_trace_thread
-- ----------------------------
DROP PROCEDURE IF EXISTS `ps_trace_thread`;
delimiter ;;
CREATE PROCEDURE `sys`.`ps_trace_thread`(IN in_thread_id BIGINT UNSIGNED, IN in_outfile VARCHAR(255), IN in_max_runtime DECIMAL(20,2), IN in_interval DECIMAL(20,2), IN in_start_fresh BOOLEAN, IN in_auto_setup BOOLEAN, IN in_debug BOOLEAN)
MODIFIES SQL DATA
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Dumps all data within Performance Schema for an instrumented thread,\n to create a DOT formatted graph file. \n \n Each resultset returned from the procedure should be used for a complete graph\n \n Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n \n Parameters\n \n in_thread_id (BIGINT UNSIGNED):\n The thread that you would like a stack trace for\n in_outfile (VARCHAR(255)):\n The filename the dot file will be written to\n in_max_runtime (DECIMAL(20,2)):\n The maximum time to keep collecting data.\n Use NULL to get the default which is 60 seconds.\n in_interval (DECIMAL(20,2)): \n How long to sleep between data collections. \n Use NULL to get the default which is 1 second.\n in_start_fresh (BOOLEAN):\n Whether to reset all Performance Schema data before tracing.\n in_auto_setup (BOOLEAN):\n Whether to disable all other threads and enable all consumers/instruments. \n This will also reset the settings at the end of the run.\n in_debug (BOOLEAN):\n Whether you would like to include file:lineno in the graph\n \n Example\n \n mysql> CALL sys.ps_trace_thread(25, CONCAT(\'/tmp/stack-\', REPLACE(NOW(), \' \', \'-\'), \'.dot\'), NULL, NULL, TRUE, TRUE, TRUE);\n +-------------------+\n | summary |\n +-------------------+\n | Disabled 1 thread |\n +-------------------+\n 1 row in set (0.00 sec)\n \n +---------------------------------------------+\n | Info |\n +---------------------------------------------+\n | Data collection starting for THREAD_ID = 25 |\n +---------------------------------------------+\n 1 row in set (0.03 sec)\n \n +-----------------------------------------------------------+\n | Info |\n +-----------------------------------------------------------+\n | Stack trace written to /tmp/stack-2014-02-16-21:18:41.dot |\n +-----------------------------------------------------------+\n 1 row in set (60.07 sec)\n \n +-------------------------------------------------------------------+\n | Convert to PDF |\n +-------------------------------------------------------------------+\n | dot -Tpdf -o /tmp/stack_25.pdf /tmp/stack-2014-02-16-21:18:41.dot |\n +-------------------------------------------------------------------+\n 1 row in set (60.07 sec)\n \n +-------------------------------------------------------------------+\n | Convert to PNG |\n +-------------------------------------------------------------------+\n | dot -Tpng -o /tmp/stack_25.png /tmp/stack-2014-02-16-21:18:41.dot |\n +-------------------------------------------------------------------+\n 1 row in set (60.07 sec)\n \n +------------------+\n | summary |\n +------------------+\n | Enabled 1 thread |\n +------------------+\n 1 row in set (60.32 sec)\n '
BEGIN DECLARE v_done bool DEFAULT FALSE; DECLARE v_start, v_runtime DECIMAL(20,2) DEFAULT 0.0; DECLARE v_min_event_id bigint unsigned DEFAULT 0; DECLARE v_this_thread_enabed ENUM('YES', 'NO'); DECLARE v_event longtext; DECLARE c_stack CURSOR FOR SELECT CONCAT(IF(nesting_event_id IS NOT NULL, CONCAT(nesting_event_id, ' -> '), ''), event_id, '; ', event_id, ' [label="', '(', sys.format_time(timer_wait), ') ', IF (event_name NOT LIKE 'wait/io%', SUBSTRING_INDEX(event_name, '/', -2), IF (event_name NOT LIKE 'wait/io/file%' OR event_name NOT LIKE 'wait/io/socket%', SUBSTRING_INDEX(event_name, '/', -4), event_name) ), IF (event_name LIKE 'transaction', IFNULL(CONCAT('\\n', wait_info), ''), ''), IF (event_name LIKE 'statement/%', IFNULL(CONCAT('\\n', wait_info), ''), ''), IF (in_debug AND event_name LIKE 'wait%', wait_info, ''), '", ', CASE WHEN event_name LIKE 'wait/io/file%' THEN 'shape=box, style=filled, color=red' WHEN event_name LIKE 'wait/io/table%' THEN 'shape=box, style=filled, color=green' WHEN event_name LIKE 'wait/io/socket%' THEN 'shape=box, style=filled, color=yellow' WHEN event_name LIKE 'wait/synch/mutex%' THEN 'style=filled, color=lightskyblue' WHEN event_name LIKE 'wait/synch/cond%' THEN 'style=filled, color=darkseagreen3' WHEN event_name LIKE 'wait/synch/rwlock%' THEN 'style=filled, color=orchid' WHEN event_name LIKE 'wait/synch/sxlock%' THEN 'style=filled, color=palevioletred' WHEN event_name LIKE 'wait/lock%' THEN 'shape=box, style=filled, color=tan' WHEN event_name LIKE 'statement/%' THEN CONCAT('shape=box, style=bold', CASE WHEN event_name LIKE 'statement/com/%' THEN ' style=filled, color=darkseagreen' ELSE IF((timer_wait/1000000000000) > @@long_query_time, ' style=filled, color=red', ' style=filled, color=lightblue') END ) WHEN event_name LIKE 'transaction' THEN 'shape=box, style=filled, color=lightblue3' WHEN event_name LIKE 'stage/%' THEN 'style=filled, color=slategray3' WHEN event_name LIKE '%idle%' THEN 'shape=box, style=filled, color=firebrick3' ELSE '' END, '];\n' ) event, event_id FROM ( (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, CONCAT('trx_id: ', IFNULL(trx_id, ''), '\\n', 'gtid: ', IFNULL(gtid, ''), '\\n', 'state: ', state, '\\n', 'mode: ', access_mode, '\\n', 'isolation: ', isolation_level, '\\n', 'autocommit: ', autocommit, '\\n', 'savepoints: ', number_of_savepoints, '\\n' ) AS wait_info FROM performance_schema.events_transactions_history_long WHERE thread_id = in_thread_id AND event_id > v_min_event_id) UNION (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, CONCAT('statement: ', sql_text, '\\n', 'errors: ', errors, '\\n', 'warnings: ', warnings, '\\n', 'lock time: ', sys.format_time(lock_time),'\\n', 'rows affected: ', rows_affected, '\\n', 'rows sent: ', rows_sent, '\\n', 'rows examined: ', rows_examined, '\\n', 'tmp tables: ', created_tmp_tables, '\\n', 'tmp disk tables: ', created_tmp_disk_tables, '\\n' 'select scan: ', select_scan, '\\n', 'select full join: ', select_full_join, '\\n', 'select full range join: ', select_full_range_join, '\\n', 'select range: ', select_range, '\\n', 'select range check: ', select_range_check, '\\n', 'sort merge passes: ', sort_merge_passes, '\\n', 'sort rows: ', sort_rows, '\\n', 'sort range: ', sort_range, '\\n', 'sort scan: ', sort_scan, '\\n', 'no index used: ', IF(no_index_used, 'TRUE', 'FALSE'), '\\n', 'no good index used: ', IF(no_good_index_used, 'TRUE', 'FALSE'), '\\n' ) AS wait_info FROM performance_schema.events_statements_history_long WHERE thread_id = in_thread_id AND event_id > v_min_event_id) UNION (SELECT thread_id, event_id, event_name, timer_wait, timer_start, nesting_event_id, null AS wait_info FROM performance_schema.events_stages_history_long WHERE thread_id = in_thread_id AND event_id > v_min_event_id) UNION (SELECT thread_id, event_id, CONCAT(event_name, IF(event_name NOT LIKE 'wait/synch/mutex%', IFNULL(CONCAT(' - ', operation), ''), ''), IF(number_of_bytes IS NOT NULL, CONCAT(' ', number_of_bytes, ' bytes'), ''), IF(event_name LIKE 'wait/io/file%', '\\n', ''), IF(object_schema IS NOT NULL, CONCAT('\\nObject: ', object_schema, '.'), ''), IF(object_name IS NOT NULL, IF (event_name LIKE 'wait/io/socket%', CONCAT('\\n', IF (object_name LIKE ':0%', @@socket, object_name)), object_name), '' ), IF(index_name IS NOT NULL, CONCAT(' Index: ', index_name), ''), '\\n' ) AS event_name, timer_wait, timer_start, nesting_event_id, source AS wait_info FROM performance_schema.events_waits_history_long WHERE thread_id = in_thread_id AND event_id > v_min_event_id) ) events ORDER BY event_id; DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE; SET @log_bin := @@sql_log_bin; SET sql_log_bin = 0; SELECT INSTRUMENTED INTO v_this_thread_enabed FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID(); CALL sys.ps_setup_disable_thread(CONNECTION_ID()); IF (in_auto_setup) THEN CALL sys.ps_setup_save(0); DELETE FROM performance_schema.setup_actors; UPDATE performance_schema.threads SET INSTRUMENTED = IF(THREAD_ID = in_thread_id, 'YES', 'NO'); UPDATE performance_schema.setup_consumers SET ENABLED = 'YES' WHERE NAME NOT LIKE '%\_history'; UPDATE performance_schema.setup_instruments SET ENABLED = 'YES', TIMED = 'YES'; END IF; IF (in_start_fresh) THEN TRUNCATE performance_schema.events_transactions_history_long; TRUNCATE performance_schema.events_statements_history_long; TRUNCATE performance_schema.events_stages_history_long; TRUNCATE performance_schema.events_waits_history_long; END IF; DROP TEMPORARY TABLE IF EXISTS tmp_events; CREATE TEMPORARY TABLE tmp_events ( event_id bigint unsigned NOT NULL, event longblob, PRIMARY KEY (event_id) ); INSERT INTO tmp_events VALUES (0, CONCAT('digraph events { rankdir=LR; nodesep=0.10;\n', '// Stack created .....: ', NOW(), '\n', '// MySQL version .....: ', VERSION(), '\n', '// MySQL hostname ....: ', @@hostname, '\n', '// MySQL port ........: ', @@port, '\n', '// MySQL socket ......: ', @@socket, '\n', '// MySQL user ........: ', CURRENT_USER(), '\n')); SELECT CONCAT('Data collection starting for THREAD_ID = ', in_thread_id) AS 'Info'; SET v_min_event_id = 0, v_start = UNIX_TIMESTAMP(), in_interval = IFNULL(in_interval, 1.00), in_max_runtime = IFNULL(in_max_runtime, 60.00); WHILE (v_runtime < in_max_runtime AND (SELECT INSTRUMENTED FROM performance_schema.threads WHERE THREAD_ID = in_thread_id) = 'YES') DO SET v_done = FALSE; OPEN c_stack; c_stack_loop: LOOP FETCH c_stack INTO v_event, v_min_event_id; IF v_done THEN LEAVE c_stack_loop; END IF; IF (LENGTH(v_event) > 0) THEN INSERT INTO tmp_events VALUES (v_min_event_id, v_event); END IF; END LOOP; CLOSE c_stack; SELECT SLEEP(in_interval) INTO @sleep; SET v_runtime = (UNIX_TIMESTAMP() - v_start); END WHILE; INSERT INTO tmp_events VALUES (v_min_event_id+1, '}'); SET @query = CONCAT('SELECT event FROM tmp_events ORDER BY event_id INTO OUTFILE ''', in_outfile, ''' FIELDS ESCAPED BY '''' LINES TERMINATED BY '''''); PREPARE stmt_output FROM @query; EXECUTE stmt_output; DEALLOCATE PREPARE stmt_output; SELECT CONCAT('Stack trace written to ', in_outfile) AS 'Info'; SELECT CONCAT('dot -Tpdf -o /tmp/stack_', in_thread_id, '.pdf ', in_outfile) AS 'Convert to PDF'; SELECT CONCAT('dot -Tpng -o /tmp/stack_', in_thread_id, '.png ', in_outfile) AS 'Convert to PNG'; DROP TEMPORARY TABLE tmp_events; IF (in_auto_setup) THEN CALL sys.ps_setup_reload_saved(); END IF; IF (v_this_thread_enabed = 'YES') THEN CALL sys.ps_setup_enable_thread(CONNECTION_ID()); END IF; SET sql_log_bin = @log_bin; END
;;
delimiter ;
-- ----------------------------
-- Procedure structure for ps_truncate_all_tables
-- ----------------------------
DROP PROCEDURE IF EXISTS `ps_truncate_all_tables`;
delimiter ;;
CREATE PROCEDURE `sys`.`ps_truncate_all_tables`(IN in_verbose BOOLEAN)
MODIFIES SQL DATA
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Truncates all summary tables within Performance Schema, \n resetting all aggregated instrumentation as a snapshot.\n \n Parameters\n \n in_verbose (BOOLEAN):\n Whether to print each TRUNCATE statement before running\n \n Example\n \n mysql> CALL sys.ps_truncate_all_tables(false);\n +---------------------+\n | summary |\n +---------------------+\n | Truncated 44 tables |\n +---------------------+\n 1 row in set (0.10 sec)\n \n Query OK, 0 rows affected (0.10 sec)\n '
BEGIN DECLARE v_done INT DEFAULT FALSE; DECLARE v_total_tables INT DEFAULT 0; DECLARE v_ps_table VARCHAR(64); DECLARE ps_tables CURSOR FOR SELECT table_name FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = 'performance_schema' AND (table_name LIKE '%summary%' OR table_name LIKE '%history%'); DECLARE CONTINUE HANDLER FOR NOT FOUND SET v_done = TRUE; OPEN ps_tables; ps_tables_loop: LOOP FETCH ps_tables INTO v_ps_table; IF v_done THEN LEAVE ps_tables_loop; END IF; SET @truncate_stmt := CONCAT('TRUNCATE TABLE performance_schema.', v_ps_table); IF in_verbose THEN SELECT CONCAT('Running: ', @truncate_stmt) AS status; END IF; PREPARE truncate_stmt FROM @truncate_stmt; EXECUTE truncate_stmt; DEALLOCATE PREPARE truncate_stmt; SET v_total_tables = v_total_tables + 1; END LOOP; CLOSE ps_tables; SELECT CONCAT('Truncated ', v_total_tables, ' tables') AS summary; END
;;
delimiter ;
-- ----------------------------
-- Function structure for quote_identifier
-- ----------------------------
DROP FUNCTION IF EXISTS `quote_identifier`;
delimiter ;;
CREATE FUNCTION `sys`.`quote_identifier`(in_identifier TEXT)
RETURNS text CHARSET utf8
NO SQL
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Takes an unquoted identifier (schema name, table name, etc.) and\n returns the identifier quoted with backticks.\n \n Parameters\n \n in_identifier (TEXT):\n The identifier to quote.\n \n Returns\n \n TEXT\n \n Example\n \n mysql> SELECT sys.quote_identifier(\'my_identifier\') AS Identifier;\n +-----------------+\n | Identifier |\n +-----------------+\n | `my_identifier` |\n +-----------------+\n 1 row in set (0.00 sec)\n \n mysql> SELECT sys.quote_identifier(\'my`idenfier\') AS Identifier;\n +----------------+\n | Identifier |\n +----------------+\n | `my``idenfier` |\n +----------------+\n 1 row in set (0.00 sec)\n '
BEGIN RETURN CONCAT('`', REPLACE(in_identifier, '`', '``'), '`'); END
;;
delimiter ;
-- ----------------------------
-- Procedure structure for statement_performance_analyzer
-- ----------------------------
DROP PROCEDURE IF EXISTS `statement_performance_analyzer`;
delimiter ;;
CREATE PROCEDURE `sys`.`statement_performance_analyzer`(IN in_action ENUM('snapshot', 'overall', 'delta', 'create_table', 'create_tmp', 'save', 'cleanup'), IN in_table VARCHAR(129), IN in_views SET ('with_runtimes_in_95th_percentile', 'analysis', 'with_errors_or_warnings', 'with_full_table_scans', 'with_sorting', 'with_temp_tables', 'custom'))
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Create a report of the statements running on the server.\n \n The views are calculated based on the overall and/or delta activity.\n \n Requires the SUPER privilege for \"SET sql_log_bin = 0;\".\n \n Parameters\n \n in_action (ENUM(\'snapshot\', \'overall\', \'delta\', \'create_tmp\', \'create_table\', \'save\', \'cleanup\')):\n The action to take. Supported actions are:\n * snapshot Store a snapshot. The default is to make a snapshot of the current content of\n performance_schema.events_statements_summary_by_digest, but by setting in_table\n this can be overwritten to copy the content of the specified table.\n The snapshot is stored in the sys.tmp_digests temporary table.\n * overall Generate analyzis based on the content specified by in_table. For the overall analyzis,\n in_table can be NOW() to use a fresh snapshot. This will overwrite an existing snapshot.\n Use NULL for in_table to use the existing snapshot. If in_table IS NULL and no snapshot\n exists, a new will be created.\n See also in_views and @sys.statement_performance_analyzer.limit.\n * delta Generate a delta analysis. The delta will be calculated between the reference table in\n in_table and the snapshot. An existing snapshot must exist.\n The action uses the sys.tmp_digests_delta temporary table.\n See also in_views and @sys.statement_performance_analyzer.limit.\n * create_table Create a regular table suitable for storing the snapshot for later use, e.g. for\n calculating deltas.\n * create_tmp Create a temporary table suitable for storing the snapshot for later use, e.g. for\n calculating deltas.\n * save Save the snapshot in the table specified by in_table. The table must exists and have\n the correct structure.\n If no snapshot exists, a new is created.\n * cleanup Remove the temporary tables used for the snapshot and delta.\n \n in_table (VARCHAR(129)):\n The table argument used for some actions. Use the format \'db1.t1\' or \'t1\' without using any backticks (`)\n for quoting. Periods (.) are not supported in the database and table names.\n \n The meaning of the table for each action supporting the argument is:\n \n * snapshot The snapshot is created based on the specified table. Set to NULL or NOW() to use\n the current content of performance_schema.events_statements_summary_by_digest.\n * overall The table with the content to create the overall analyzis for. The following values\n can be used:\n - A table name - use the content of that table.\n - NOW() - create a fresh snapshot and overwrite the existing snapshot.\n - NULL - use the last stored snapshot.\n * delta The table name is mandatory and specified the reference view to compare the currently\n stored snapshot against. If no snapshot exists, a new will be created.\n * create_table The name of the regular table to create.\n * create_tmp The name of the temporary table to create.\n * save The name of the table to save the currently stored snapshot into.\n \n in_views (SET (\'with_runtimes_in_95th_percentile\', \'analysis\', \'with_errors_or_warnings\',\n \'with_full_table_scans\', \'with_sorting\', \'with_temp_tables\', \'custom\'))\n Which views to include: * with_runtimes_in_95th_percentile Based on the sys.statements_with_runtimes_in_95th_percentile view * analysis Based on the sys.statement_analysis view * with_errors_or_warnings Based on the sys.statements_with_errors_or_warnings view * with_full_table_scans Based on the sys.statements_with_full_table_scans view * with_sorting Based on the sys.statements_with_sorting view * with_temp_tables Based on the sys.statements_with_temp_tables view * custom Use a custom view. This view must be specified in @sys.statement_performance_analyzer.view to an existing view or a query Default is to include all except \'custom\'. Configuration Options sys.statement_performance_analyzer.limit The maximum number of rows to include for the views that does not have a built-in limit (e.g. the 95th percentile view). If not set the limit is 100. sys.statement_performance_analyzer.view Used together with the \'custom\' view. If the value contains a space, it is considered a query, otherwise it must be an existing view querying the performance_schema.events_statements_summary_by_digest table. There cannot be any limit clause including in the query or view definition if @sys.statement_performance_analyzer.limit > 0. If specifying a view, use the same format as for in_table. sys.debug Whether to provide debugging output. Default is \'OFF\'. Set to \'ON\' to include. Example To create a report with the queries in the 95th percentile since last truncate of performance_schema.events_statements_summary_by_digest and the delta for a 1 minute period: 1. Create a temporary table to store the initial snapshot. 2. Create the initial snapshot. 3. Save the initial snapshot in the temporary table. 4. Wait one minute. 5. Create a new snapshot. 6. Perform analyzis based on the new snapshot. 7. Perform analyzis based on the delta between the initial and new snapshots. mysql> CALL sys.statement_performance_analyzer(\'create_tmp\', \'mydb.tmp_digests_ini\', NULL); Query OK, 0 rows affected (0.08 sec) mysql> CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL); Query OK, 0 rows affected (0.02 sec) mysql> CALL sys.statement_performance_analyzer(\'save\', \'mydb.tmp_digests_ini\', NULL); Query OK, 0 rows affected (0.00 sec) mysql> DO SLEEP(60); Query OK, 0 rows affected (1 min 0.00 sec) mysql> CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL); Query OK, 0 rows affected (0.02 sec) mysql> CALL sys.statement_performance_analyzer(\'overall\', NULL, \'with_runtimes_in_95th_percentile\'); +-----------------------------------------+ | Next Output | +-----------------------------------------+ | Queries with Runtime in 95th Percentile | +-----------------------------------------+ 1 row in set (0.05 sec) ... mysql> CALL sys.statement_performance_analyzer(\'delta\', \'mydb.tmp_digests_ini\', \'with_runtimes_in_95th_percentile\'); +-----------------------------------------+ | Next Output | +-----------------------------------------+ | Queries with Runtime in 95th Percentile | +-----------------------------------------+ 1 row in set (0.03 sec) ... To create an overall report of the 95th percentile queries and the top 10 queries with full table scans: mysql> CALL sys.statement_performance_analyzer(\'snapshot\', NULL, NULL); Query OK, 0 rows affected (0.01 sec) mysql> SET @sys.statement_performance_analyzer.limit = 10; Query OK, 0 rows affected (0.00 sec) mysql> CALL sys.statement_performance_analyzer(\'overall\', NULL, \'with_runtimes_in_95th_percentile,with_full_table_scans\'); +-----------------------------------------+ | Next Output | +-----------------------------------------+ | Queries with Runtime in 95th Percentile | +-----------------------------------------+ 1 row in set (0.01 sec) ... +-------------------------------------+ | Next Output | +-------------------------------------+ | Top 10 Queries with Full Table Scan | +-------------------------------------+ 1 row in set (0.09 sec) ... Use a custom view showing the top 10 query sorted by total execution time refreshing the view every minute using the watch command in Linux. mysql> CREATE OR REPLACE VIEW mydb.my_statements AS -> SELECT sys.format_statement(DIGEST_TEXT) AS query, -> SCHEMA_NAME AS db, -> COUNT_STAR AS exec_count, -> sys.format_time(SUM_TIMER_WAIT) AS total_latency, -> sys.format_time(AVG_TIMER_WAIT) AS avg_latency, -> ROUND(IFNULL(SUM_ROWS_SENT / NULLIF(COUNT_STAR, 0), 0)) AS rows_sent_avg, -> ROUND(IFNULL(SUM_ROWS_EXAMINED / NULLIF(COUNT_STAR, 0), 0)) AS rows_examined_avg, -> ROUND(IFNULL(SUM_ROWS_AFFECTED / NULLIF(COUNT_STAR, 0), 0)) AS rows_affected_avg, -> DIGEST AS digest -> FROM performance_schema.events_statements_summary_by_digest -> ORDER BY SUM_TIMER_WAIT DESC; Query OK, 0 rows affected (0.01 sec) mysql> CALL sys.statement_performance_analyzer(\'create_table\', \'mydb.digests_prev\', NULL); Query OK, 0 rows affected (0.10 sec) shell$ watch -n 60 \"mysql sys --table -e \" > SET @sys.statement_performance_analyzer.view = \'mydb.my_statements\'; > SET @sys.statement_performance_analyzer.limit = 10; > CALL statement_performance_analyzer(\'snapshot\', NULL, NULL); > CALL statement_performance_analyzer(\'delta\', \'mydb.digests_prev\', \'custom\'); > CALL statement_performance_analyzer(\'save\', \'mydb.digests_prev\', NULL); > \"\" Every 60.0s: mysql sys --table -e \" ... Mon Dec 22 10:58:51 2014 +----------------------------------+ | Next Output | +----------------------------------+ | Top 10 Queries Using Custom View | +----------------------------------+ +-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+ | query | db | exec_count | total_latency | avg_latency | rows_sent_avg | rows_examined_avg | rows_affected_avg | digest | +-------------------+-------+------------+---------------+-------------+---------------+-------------------+-------------------+----------------------------------+ ... '
BEGIN DECLARE v_table_exists, v_tmp_digests_table_exists, v_custom_view_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY') DEFAULT ''; DECLARE v_this_thread_enabled ENUM('YES', 'NO'); DECLARE v_force_new_snapshot BOOLEAN DEFAULT FALSE; DECLARE v_digests_table VARCHAR(133); DECLARE v_quoted_table, v_quoted_custom_view VARCHAR(133) DEFAULT ''; DECLARE v_table_db, v_table_name, v_custom_db, v_custom_name VARCHAR(64); DECLARE v_digest_table_template, v_checksum_ref, v_checksum_table text; DECLARE v_sql longtext; DECLARE v_error_msg VARCHAR(128); SELECT INSTRUMENTED INTO v_this_thread_enabled FROM performance_schema.threads WHERE PROCESSLIST_ID = CONNECTION_ID(); IF (v_this_thread_enabled = 'YES') THEN CALL sys.ps_setup_disable_thread(CONNECTION_ID()); END IF; SET @log_bin := @@sql_log_bin; IF (@log_bin = 1) THEN SET sql_log_bin = 0; END IF; IF (@sys.statement_performance_analyzer.limit IS NULL) THEN SET @sys.statement_performance_analyzer.limit = sys.sys_get_config('statement_performance_analyzer.limit', '100'); END IF; IF (@sys.debug IS NULL) THEN SET @sys.debug = sys.sys_get_config('debug' , 'OFF'); END IF; IF (in_table = 'NOW()') THEN SET v_force_new_snapshot = TRUE, in_table = NULL; ELSEIF (in_table IS NOT NULL) THEN IF (NOT INSTR(in_table, '.')) THEN SET v_table_db = DATABASE(), v_table_name = in_table; ELSE SET v_table_db = SUBSTRING_INDEX(in_table, '.', 1); SET v_table_name = SUBSTRING(in_table, CHAR_LENGTH(v_table_db)+2); END IF; SET v_quoted_table = CONCAT('`', v_table_db, '`.`', v_table_name, '`'); IF (@sys.debug = 'ON') THEN SELECT CONCAT('in_table is: db = ''', v_table_db, ''', table = ''', v_table_name, '''') AS 'Debug'; END IF; IF (v_table_db = DATABASE() AND (v_table_name = 'tmp_digests' OR v_table_name = 'tmp_digests_delta')) THEN SET v_error_msg = CONCAT('Invalid value for in_table: ', v_quoted_table, ' is reserved table name.'); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = v_error_msg; END IF; CALL sys.table_exists(v_table_db, v_table_name, v_table_exists); IF (@sys.debug = 'ON') THEN SELECT CONCAT('v_table_exists = ', v_table_exists) AS 'Debug'; END IF; IF (v_table_exists = 'BASE TABLE') THEN SET v_checksum_ref = ( SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'performance_schema' AND TABLE_NAME = 'events_statements_summary_by_digest' ), v_checksum_table = ( SELECT GROUP_CONCAT(CONCAT(COLUMN_NAME, COLUMN_TYPE) ORDER BY ORDINAL_POSITION) AS Checksum FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = v_table_db AND TABLE_NAME = v_table_name ); IF (v_checksum_ref v_checksum_table) THEN SET v_error_msg = CONCAT('The table ', IF(CHAR_LENGTH(v_quoted_table) > 93, CONCAT('...', SUBSTRING(v_quoted_table, -90)), v_quoted_table), ' has the wrong definition.'); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = v_error_msg; END IF; END IF; END IF; IF (in_views IS NULL OR in_views = '') THEN SET in_views = 'with_runtimes_in_95th_percentile,analysis,with_errors_or_warnings,with_full_table_scans,with_sorting,with_temp_tables'; END IF; CALL sys.table_exists(DATABASE(), 'tmp_digests', v_tmp_digests_table_exists); IF (@sys.debug = 'ON') THEN SELECT CONCAT('v_tmp_digests_table_exists = ', v_tmp_digests_table_exists) AS 'Debug'; END IF; CASE WHEN in_action IN ('snapshot', 'overall') THEN IF (in_table IS NOT NULL) THEN IF (NOT v_table_exists IN ('TEMPORARY', 'BASE TABLE')) THEN SET v_error_msg = CONCAT('The ', in_action, ' action requires in_table to be NULL, NOW() or specify an existing table.', ' The table ', IF(CHAR_LENGTH(v_quoted_table) > 16, CONCAT('...', SUBSTRING(v_quoted_table, -13)), v_quoted_table), ' does not exist.'); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = v_error_msg; END IF; END IF; WHEN in_action IN ('delta', 'save') THEN IF (v_table_exists NOT IN ('TEMPORARY', 'BASE TABLE')) THEN SET v_error_msg = CONCAT('The ', in_action, ' action requires in_table to be an existing table.', IF(in_table IS NOT NULL, CONCAT(' The table ', IF(CHAR_LENGTH(v_quoted_table) > 39, CONCAT('...', SUBSTRING(v_quoted_table, -36)), v_quoted_table), ' does not exist.'), '')); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = v_error_msg; END IF; IF (in_action = 'delta' AND v_tmp_digests_table_exists 'TEMPORARY') THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An existing snapshot generated with the statement_performance_analyzer() must exist.'; END IF; WHEN in_action = 'create_tmp' THEN IF (v_table_exists = 'TEMPORARY') THEN SET v_error_msg = CONCAT('Cannot create the table ', IF(CHAR_LENGTH(v_quoted_table) > 72, CONCAT('...', SUBSTRING(v_quoted_table, -69)), v_quoted_table), ' as it already exists.'); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = v_error_msg; END IF; WHEN in_action = 'create_table' THEN IF (v_table_exists '') THEN SET v_error_msg = CONCAT('Cannot create the table ', IF(CHAR_LENGTH(v_quoted_table) > 52, CONCAT('...', SUBSTRING(v_quoted_table, -49)), v_quoted_table), ' as it already exists', IF(v_table_exists = 'TEMPORARY', ' as a temporary table.', '.')); SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = v_error_msg; END IF; WHEN in_action = 'cleanup' THEN DO (SELECT 1); ELSE SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Unknown action. Supported actions are: cleanup, create_table, create_tmp, delta, overall, save, snapshot'; END CASE; SET v_digest_table_template = 'CREATE %{TEMPORARY}TABLE %{TABLE_NAME} ( `SCHEMA_NAME` varchar(64) DEFAULT NULL, `DIGEST` varchar(32) DEFAULT NULL, `DIGEST_TEXT` longtext, `COUNT_STAR` bigint(20) unsigned NOT NULL, `SUM_TIMER_WAIT` bigint(20) unsigned NOT NULL, `MIN_TIMER_WAIT` bigint(20) unsigned NOT NULL, `AVG_TIMER_WAIT` bigint(20) unsigned NOT NULL, `MAX_TIMER_WAIT` bigint(20) unsigned NOT NULL, `SUM_LOCK_TIME` bigint(20) unsigned NOT NULL, `SUM_ERRORS` bigint(20) unsigned NOT NULL, `SUM_WARNINGS` bigint(20) unsigned NOT NULL, `SUM_ROWS_AFFECTED` bigint(20) unsigned NOT NULL, `SUM_ROWS_SENT` bigint(20) unsigned NOT NULL, `SUM_ROWS_EXAMINED` bigint(20) unsigned NOT NULL, `SUM_CREATED_TMP_DISK_TABLES` bigint(20) unsigned NOT NULL, `SUM_CREATED_TMP_TABLES` bigint(20) unsigned NOT NULL, `SUM_SELECT_FULL_JOIN` bigint(20) unsigned NOT NULL, `SUM_SELECT_FULL_RANGE_JOIN` bigint(20) unsigned NOT NULL, `SUM_SELECT_RANGE` bigint(20) unsigned NOT NULL, `SUM_SELECT_RANGE_CHECK` bigint(20) unsigned NOT NULL, `SUM_SELECT_SCAN` bigint(20) unsigned NOT NULL, `SUM_SORT_MERGE_PASSES` bigint(20) unsigned NOT NULL, `SUM_SORT_RANGE` bigint(20) unsigned NOT NULL, `SUM_SORT_ROWS` bigint(20) unsigned NOT NULL, `SUM_SORT_SCAN` bigint(20) unsigned NOT NULL, `SUM_NO_INDEX_USED` bigint(20) unsigned NOT NULL, `SUM_NO_GOOD_INDEX_USED` bigint(20) unsigned NOT NULL, `FIRST_SEEN` timestamp NULL DEFAULT NULL, `LAST_SEEN` timestamp NULL DEFAULT NULL, INDEX (SCHEMA_NAME, DIGEST) ) DEFAULT CHARSET=utf8'; IF (v_force_new_snapshot OR in_action = 'snapshot' OR (in_action = 'overall' AND in_table IS NULL) OR (in_action = 'save' AND v_tmp_digests_table_exists 'TEMPORARY') ) THEN IF (v_tmp_digests_table_exists = 'TEMPORARY') THEN IF (@sys.debug = 'ON') THEN SELECT 'DROP TEMPORARY TABLE IF EXISTS tmp_digests' AS 'Debug'; END IF; DROP TEMPORARY TABLE IF EXISTS tmp_digests; END IF; CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, '%{TEMPORARY}', 'TEMPORARY '), '%{TABLE_NAME}', 'tmp_digests')); SET v_sql = CONCAT('INSERT INTO tmp_digests SELECT * FROM ', IF(in_table IS NULL OR in_action = 'save', 'performance_schema.events_statements_summary_by_digest', v_quoted_table)); CALL sys.execute_prepared_stmt(v_sql); END IF; IF (in_action IN ('create_table', 'create_tmp')) THEN IF (in_action = 'create_table') THEN CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, '%{TEMPORARY}', ''), '%{TABLE_NAME}', v_quoted_table)); ELSE CALL sys.execute_prepared_stmt(REPLACE(REPLACE(v_digest_table_template, '%{TEMPORARY}', 'TEMPORARY '), '%{TABLE_NAME}', v_quoted_table)); END IF; ELSEIF (in_action = 'save') THEN CALL sys.execute_prepared_stmt(CONCAT('DELETE FROM ', v_quoted_table)); CALL sys.execute_prepared_stmt(CONCAT('INSERT INTO ', v_quoted_table, ' SELECT * FROM tmp_digests')); ELSEIF (in_action = 'cleanup') THEN DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests; DROP TEMPORARY TABLE IF EXISTS sys.tmp_digests_delta; ELSEIF (in_action IN ('overall', 'delta')) THEN IF (in_action = 'overall') THEN IF (in_table IS NULL) THEN SET v_digests_table = 'tmp_digests'; ELSE SET v_digests_table = v_quoted_table; END IF; ELSE SET v_digests_table = 'tmp_digests_delta'; DROP TEMPORARY TABLE IF EXISTS tmp_digests_delta; CREATE TEMPORARY TABLE tmp_digests_delta LIKE tmp_digests; SET v_sql = CONCAT('INSERT INTO tmp_digests_delta SELECT `d_end`.`SCHEMA_NAME`, `d_end`.`DIGEST`, `d_end`.`DIGEST_TEXT`, `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) AS ''COUNT_STAR'', `d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0) AS ''SUM_TIMER_WAIT'', `d_end`.`MIN_TIMER_WAIT` AS ''MIN_TIMER_WAIT'', IFNULL((`d_end`.`SUM_TIMER_WAIT`-IFNULL(`d_start`.`SUM_TIMER_WAIT`, 0))/NULLIF(`d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0), 0), 0) AS ''AVG_TIMER_WAIT'', `d_end`.`MAX_TIMER_WAIT` AS ''MAX_TIMER_WAIT'', `d_end`.`SUM_LOCK_TIME`-IFNULL(`d_start`.`SUM_LOCK_TIME`, 0) AS ''SUM_LOCK_TIME'', `d_end`.`SUM_ERRORS`-IFNULL(`d_start`.`SUM_ERRORS`, 0) AS ''SUM_ERRORS'', `d_end`.`SUM_WARNINGS`-IFNULL(`d_start`.`SUM_WARNINGS`, 0) AS ''SUM_WARNINGS'', `d_end`.`SUM_ROWS_AFFECTED`-IFNULL(`d_start`.`SUM_ROWS_AFFECTED`, 0) AS ''SUM_ROWS_AFFECTED'', `d_end`.`SUM_ROWS_SENT`-IFNULL(`d_start`.`SUM_ROWS_SENT`, 0) AS ''SUM_ROWS_SENT'', `d_end`.`SUM_ROWS_EXAMINED`-IFNULL(`d_start`.`SUM_ROWS_EXAMINED`, 0) AS ''SUM_ROWS_EXAMINED'', `d_end`.`SUM_CREATED_TMP_DISK_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_DISK_TABLES`, 0) AS ''SUM_CREATED_TMP_DISK_TABLES'', `d_end`.`SUM_CREATED_TMP_TABLES`-IFNULL(`d_start`.`SUM_CREATED_TMP_TABLES`, 0) AS ''SUM_CREATED_TMP_TABLES'', `d_end`.`SUM_SELECT_FULL_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_JOIN`, 0) AS ''SUM_SELECT_FULL_JOIN'', `d_end`.`SUM_SELECT_FULL_RANGE_JOIN`-IFNULL(`d_start`.`SUM_SELECT_FULL_RANGE_JOIN`, 0) AS ''SUM_SELECT_FULL_RANGE_JOIN'', `d_end`.`SUM_SELECT_RANGE`-IFNULL(`d_start`.`SUM_SELECT_RANGE`, 0) AS ''SUM_SELECT_RANGE'', `d_end`.`SUM_SELECT_RANGE_CHECK`-IFNULL(`d_start`.`SUM_SELECT_RANGE_CHECK`, 0) AS ''SUM_SELECT_RANGE_CHECK'', `d_end`.`SUM_SELECT_SCAN`-IFNULL(`d_start`.`SUM_SELECT_SCAN`, 0) AS ''SUM_SELECT_SCAN'', `d_end`.`SUM_SORT_MERGE_PASSES`-IFNULL(`d_start`.`SUM_SORT_MERGE_PASSES`, 0) AS ''SUM_SORT_MERGE_PASSES'', `d_end`.`SUM_SORT_RANGE`-IFNULL(`d_start`.`SUM_SORT_RANGE`, 0) AS ''SUM_SORT_RANGE'', `d_end`.`SUM_SORT_ROWS`-IFNULL(`d_start`.`SUM_SORT_ROWS`, 0) AS ''SUM_SORT_ROWS'', `d_end`.`SUM_SORT_SCAN`-IFNULL(`d_start`.`SUM_SORT_SCAN`, 0) AS ''SUM_SORT_SCAN'', `d_end`.`SUM_NO_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_INDEX_USED`, 0) AS ''SUM_NO_INDEX_USED'', `d_end`.`SUM_NO_GOOD_INDEX_USED`-IFNULL(`d_start`.`SUM_NO_GOOD_INDEX_USED`, 0) AS ''SUM_NO_GOOD_INDEX_USED'', `d_end`.`FIRST_SEEN`, `d_end`.`LAST_SEEN` FROM tmp_digests d_end LEFT OUTER JOIN ', v_quoted_table, ' d_start ON `d_start`.`DIGEST` = `d_end`.`DIGEST` AND (`d_start`.`SCHEMA_NAME` = `d_end`.`SCHEMA_NAME` OR (`d_start`.`SCHEMA_NAME` IS NULL AND `d_end`.`SCHEMA_NAME` IS NULL) ) WHERE `d_end`.`COUNT_STAR`-IFNULL(`d_start`.`COUNT_STAR`, 0) > 0'); CALL sys.execute_prepared_stmt(v_sql); END IF; IF (FIND_IN_SET('with_runtimes_in_95th_percentile', in_views)) THEN SELECT 'Queries with Runtime in 95th Percentile' AS 'Next Output'; DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution1; DROP TEMPORARY TABLE IF EXISTS tmp_digest_avg_latency_distribution2; DROP TEMPORARY TABLE IF EXISTS tmp_digest_95th_percentile_by_avg_us; CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution1 ( cnt bigint unsigned NOT NULL, avg_us decimal(21,0) NOT NULL, PRIMARY KEY (avg_us) ) ENGINE=InnoDB; SET v_sql = CONCAT('INSERT INTO tmp_digest_avg_latency_distribution1 SELECT COUNT(*) cnt, ROUND(avg_timer_wait/1000000) AS avg_us FROM ', v_digests_table, ' GROUP BY avg_us'); CALL sys.execute_prepared_stmt(v_sql); CREATE TEMPORARY TABLE tmp_digest_avg_latency_distribution2 LIKE tmp_digest_avg_latency_distribution1; INSERT INTO tmp_digest_avg_latency_distribution2 SELECT * FROM tmp_digest_avg_latency_distribution1; CREATE TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us ( avg_us decimal(21,0) NOT NULL, percentile decimal(46,4) NOT NULL, PRIMARY KEY (avg_us) ) ENGINE=InnoDB; SET v_sql = CONCAT('INSERT INTO tmp_digest_95th_percentile_by_avg_us SELECT s2.avg_us avg_us, IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM ', v_digests_table, '), 0), 0) percentile FROM tmp_digest_avg_latency_distribution1 AS s1 JOIN tmp_digest_avg_latency_distribution2 AS s2 ON s1.avg_us 0.95 ORDER BY percentile LIMIT 1'); CALL sys.execute_prepared_stmt(v_sql); SET v_sql = REPLACE( REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_runtimes_in_95th_percentile' ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ), 'sys.x$ps_digest_95th_percentile_by_avg_us', '`sys`.`x$ps_digest_95th_percentile_by_avg_us`' ); CALL sys.execute_prepared_stmt(v_sql); DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution1; DROP TEMPORARY TABLE tmp_digest_avg_latency_distribution2; DROP TEMPORARY TABLE tmp_digest_95th_percentile_by_avg_us; END IF; IF (FIND_IN_SET('analysis', in_views)) THEN SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries Ordered by Total Latency') AS 'Next Output'; SET v_sql = REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statement_analysis' ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ); IF (@sys.statement_performance_analyzer.limit > 0) THEN SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit); END IF; CALL sys.execute_prepared_stmt(v_sql); END IF; IF (FIND_IN_SET('with_errors_or_warnings', in_views)) THEN SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Errors') AS 'Next Output'; SET v_sql = REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_errors_or_warnings' ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ); IF (@sys.statement_performance_analyzer.limit > 0) THEN SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit); END IF; CALL sys.execute_prepared_stmt(v_sql); END IF; IF (FIND_IN_SET('with_full_table_scans', in_views)) THEN SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Full Table Scan') AS 'Next Output'; SET v_sql = REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_full_table_scans' ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ); IF (@sys.statement_performance_analyzer.limit > 0) THEN SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit); END IF; CALL sys.execute_prepared_stmt(v_sql); END IF; IF (FIND_IN_SET('with_sorting', in_views)) THEN SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Sorting') AS 'Next Output'; SET v_sql = REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_sorting' ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ); IF (@sys.statement_performance_analyzer.limit > 0) THEN SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit); END IF; CALL sys.execute_prepared_stmt(v_sql); END IF; IF (FIND_IN_SET('with_temp_tables', in_views)) THEN SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries with Internal Temporary Tables') AS 'Next Output'; SET v_sql = REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'statements_with_temp_tables' ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ); IF (@sys.statement_performance_analyzer.limit > 0) THEN SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit); END IF; CALL sys.execute_prepared_stmt(v_sql); END IF; IF (FIND_IN_SET('custom', in_views)) THEN SELECT CONCAT('Top ', @sys.statement_performance_analyzer.limit, ' Queries Using Custom View') AS 'Next Output'; IF (@sys.statement_performance_analyzer.view IS NULL) THEN SET @sys.statement_performance_analyzer.view = sys.sys_get_config('statement_performance_analyzer.view', NULL); END IF; IF (@sys.statement_performance_analyzer.view IS NULL) THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The @sys.statement_performance_analyzer.view user variable must be set with the view or query to use.'; END IF; IF (NOT INSTR(@sys.statement_performance_analyzer.view, ' ')) THEN IF (NOT INSTR(@sys.statement_performance_analyzer.view, '.')) THEN SET v_custom_db = DATABASE(), v_custom_name = @sys.statement_performance_analyzer.view; ELSE SET v_custom_db = SUBSTRING_INDEX(@sys.statement_performance_analyzer.view, '.', 1); SET v_custom_name = SUBSTRING(@sys.statement_performance_analyzer.view, CHAR_LENGTH(v_custom_db)+2); END IF; CALL sys.table_exists(v_custom_db, v_custom_name, v_custom_view_exists); IF (v_custom_view_exists 'VIEW') THEN SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The @sys.statement_performance_analyzer.view user variable is set but specified neither an existing view nor a query.'; END IF; SET v_sql = REPLACE( (SELECT VIEW_DEFINITION FROM information_schema.VIEWS WHERE TABLE_SCHEMA = v_custom_db AND TABLE_NAME = v_custom_name ), '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table ); ELSE SET v_sql = REPLACE(@sys.statement_performance_analyzer.view, '`performance_schema`.`events_statements_summary_by_digest`', v_digests_table); END IF; IF (@sys.statement_performance_analyzer.limit > 0) THEN SET v_sql = CONCAT(v_sql, ' LIMIT ', @sys.statement_performance_analyzer.limit); END IF; CALL sys.execute_prepared_stmt(v_sql); END IF; END IF; IF (v_this_thread_enabled = 'YES') THEN CALL sys.ps_setup_enable_thread(CONNECTION_ID()); END IF; IF (@log_bin = 1) THEN SET sql_log_bin = @log_bin; END IF; END
;;
delimiter ;
-- ----------------------------
-- Function structure for sys_get_config
-- ----------------------------
DROP FUNCTION IF EXISTS `sys_get_config`;
delimiter ;;
CREATE FUNCTION `sys`.`sys_get_config`(in_variable_name VARCHAR(128), in_default_value VARCHAR(128))
RETURNS varchar(128) CHARSET utf8
READS SQL DATA
DETERMINISTIC
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Returns the value for the requested variable using the following logic:\n \n 1. If the option exists in sys.sys_config return the value from there.\n 2. Else fall back on the provided default value.\n \n Notes for using sys_get_config():\n \n * If the default value argument to sys_get_config() is NULL and case 2. is reached, NULL is returned.\n It is then expected that the caller is able to handle NULL for the given configuration option.\n * The convention is to name the user variables @sys.. It is that\n is stored in the sys_config table and is what is expected as the argument to sys_get_config().\n * If you want to check whether the configuration option has already been set and if not assign with\n the return value of sys_get_config() you can use IFNULL(...) (see example below). However this should\n not be done inside a loop (e.g. for each row in a result set) as for repeated calls where assignment\n is only needed in the first iteration using IFNULL(...) is expected to be significantly slower than\n using an IF (...) THEN ... END IF; block (see example below).\n \n Parameters\n \n in_variable_name (VARCHAR(128)):\n The name of the config option to return the value for.\n \n in_default_value (VARCHAR(128)):\n The default value to return if the variable does not exist in sys.sys_config.\n \n Returns\n \n VARCHAR(128)\n \n Example\n \n mysql> SELECT sys.sys_get_config(\'statement_truncate_len\', 128) AS Value;\n +-------+\n | Value |\n +-------+\n | 64 |\n +-------+\n 1 row in set (0.00 sec)\n \n mysql> SET @sys.statement_truncate_len = IFNULL(@sys.statement_truncate_len, sys.sys_get_config(\'statement_truncate_len\', 64));\n Query OK, 0 rows affected (0.00 sec)\n \n IF (@sys.statement_truncate_len IS NULL) THEN\n SET @sys.statement_truncate_len = sys.sys_get_config(\'statement_truncate_len\', 64);\n END IF;\n '
BEGIN DECLARE v_value VARCHAR(128) DEFAULT NULL; SET v_value = (SELECT value FROM sys.sys_config WHERE variable = in_variable_name); IF (v_value IS NULL) THEN SET v_value = in_default_value; END IF; RETURN v_value; END
;;
delimiter ;
-- ----------------------------
-- Procedure structure for table_exists
-- ----------------------------
DROP PROCEDURE IF EXISTS `table_exists`;
delimiter ;;
CREATE PROCEDURE `sys`.`table_exists`(IN in_db VARCHAR(64), IN in_table VARCHAR(64), OUT out_exists ENUM('', 'BASE TABLE', 'VIEW', 'TEMPORARY'))
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Tests whether the table specified in in_db and in_table exists either as a regular\n table, or as a temporary table. The returned value corresponds to the table that\n will be used, so if there\'s both a temporary and a permanent table with the given\n name, then \'TEMPORARY\' will be returned.\n \n Parameters\n \n in_db (VARCHAR(64)):\n The database name to check for the existance of the table in.\n \n in_table (VARCHAR(64)):\n The name of the table to check the existance of.\n \n out_exists ENUM(\'\', \'BASE TABLE\', \'VIEW\', \'TEMPORARY\'):\n The return value: whether the table exists. The value is one of:\n * \'\' - the table does not exist neither as a base table, view, nor temporary table.\n * \'BASE TABLE\' - the table name exists as a permanent base table table.\n * \'VIEW\' - the table name exists as a view.\n * \'TEMPORARY\' - the table name exists as a temporary table.\n \n Example\n \n mysql> CREATE DATABASE db1;\n Query OK, 1 row affected (0.07 sec)\n \n mysql> use db1;\n Database changed\n mysql> CREATE TABLE t1 (id INT PRIMARY KEY);\n Query OK, 0 rows affected (0.08 sec)\n \n mysql> CREATE TABLE t2 (id INT PRIMARY KEY);\n Query OK, 0 rows affected (0.08 sec)\n \n mysql> CREATE view v_t1 AS SELECT * FROM t1;\n Query OK, 0 rows affected (0.00 sec)\n \n mysql> CREATE TEMPORARY TABLE t1 (id INT PRIMARY KEY);\n Query OK, 0 rows affected (0.00 sec)\n \n mysql> CALL sys.table_exists(\'db1\', \'t1\', @exists); SELECT @exists;\n Query OK, 0 rows affected (0.00 sec)\n \n +------------+\n | @exists |\n +------------+\n | TEMPORARY |\n +------------+\n 1 row in set (0.00 sec)\n \n mysql> CALL sys.table_exists(\'db1\', \'t2\', @exists); SELECT @exists;\n Query OK, 0 rows affected (0.00 sec)\n \n +------------+\n | @exists |\n +------------+\n | BASE TABLE |\n +------------+\n 1 row in set (0.01 sec)\n \n mysql> CALL sys.table_exists(\'db1\', \'v_t1\', @exists); SELECT @exists;\n Query OK, 0 rows affected (0.00 sec)\n \n +---------+\n | @exists |\n +---------+\n | VIEW |\n +---------+\n 1 row in set (0.00 sec)\n \n mysql> CALL sys.table_exists(\'db1\', \'t3\', @exists); SELECT @exists;\n Query OK, 0 rows affected (0.01 sec)\n \n +---------+\n | @exists |\n +---------+\n | |\n +---------+\n 1 row in set (0.00 sec)\n '
BEGIN DECLARE v_error BOOLEAN DEFAULT FALSE; DECLARE CONTINUE HANDLER FOR 1050 SET v_error = TRUE; DECLARE CONTINUE HANDLER FOR 1146 SET v_error = TRUE; SET out_exists = ''; IF (EXISTS(SELECT 1 FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table)) THEN SET @sys.tmp.table_exists.SQL = CONCAT('CREATE TEMPORARY TABLE `', in_db, '`.`', in_table, '` (id INT PRIMARY KEY)'); PREPARE stmt_create_table FROM @sys.tmp.table_exists.SQL; EXECUTE stmt_create_table; DEALLOCATE PREPARE stmt_create_table; IF (v_error) THEN SET out_exists = 'TEMPORARY'; ELSE SET @sys.tmp.table_exists.SQL = CONCAT('DROP TEMPORARY TABLE `', in_db, '`.`', in_table, '`'); PREPARE stmt_drop_table FROM @sys.tmp.table_exists.SQL; EXECUTE stmt_drop_table; DEALLOCATE PREPARE stmt_drop_table; SET out_exists = (SELECT TABLE_TYPE FROM information_schema.TABLES WHERE TABLE_SCHEMA = in_db AND TABLE_NAME = in_table); END IF; ELSE SET @sys.tmp.table_exists.SQL = CONCAT('SELECT COUNT(*) FROM `', in_db, '`.`', in_table, '`'); PREPARE stmt_select FROM @sys.tmp.table_exists.SQL; IF (NOT v_error) THEN DEALLOCATE PREPARE stmt_select; SET out_exists = 'TEMPORARY'; END IF; END IF; END
;;
delimiter ;
-- ----------------------------
-- Function structure for version_major
-- ----------------------------
DROP FUNCTION IF EXISTS `version_major`;
delimiter ;;
CREATE FUNCTION `sys`.`version_major`()
RETURNS tinyint(3) unsigned
NO SQL
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Returns the major version of MySQL Server.\n \n Returns\n \n TINYINT UNSIGNED\n \n Example\n \n mysql> SELECT VERSION(), sys.version_major();\n +--------------------------------------+---------------------+\n | VERSION() | sys.version_major() |\n +--------------------------------------+---------------------+\n | 5.7.9-enterprise-commercial-advanced | 5 |\n +--------------------------------------+---------------------+\n 1 row in set (0.00 sec)\n '
BEGIN RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', 1); END
;;
delimiter ;
-- ----------------------------
-- Function structure for version_minor
-- ----------------------------
DROP FUNCTION IF EXISTS `version_minor`;
delimiter ;;
CREATE FUNCTION `sys`.`version_minor`()
RETURNS tinyint(3) unsigned
NO SQL
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Returns the minor (release series) version of MySQL Server.\n \n Returns\n \n TINYINT UNSIGNED\n \n Example\n \n mysql> SELECT VERSION(), sys.server_minor();\n +--------------------------------------+---------------------+\n | VERSION() | sys.version_minor() |\n +--------------------------------------+---------------------+\n | 5.7.9-enterprise-commercial-advanced | 7 |\n +--------------------------------------+---------------------+\n 1 row in set (0.00 sec)\n '
BEGIN RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', 2), '.', -1); END
;;
delimiter ;
-- ----------------------------
-- Function structure for version_patch
-- ----------------------------
DROP FUNCTION IF EXISTS `version_patch`;
delimiter ;;
CREATE FUNCTION `sys`.`version_patch`()
RETURNS tinyint(3) unsigned
NO SQL
SQL SECURITY INVOKER
COMMENT '\n Description\n \n Returns the patch release version of MySQL Server.\n \n Returns\n \n TINYINT UNSIGNED\n \n Example\n \n mysql> SELECT VERSION(), sys.version_patch();\n +--------------------------------------+---------------------+\n | VERSION() | sys.version_patch() |\n +--------------------------------------+---------------------+\n | 5.7.9-enterprise-commercial-advanced | 9 |\n +--------------------------------------+---------------------+\n 1 row in set (0.00 sec)\n '
BEGIN RETURN SUBSTRING_INDEX(SUBSTRING_INDEX(VERSION(), '-', 1), '.', -1); END
;;
delimiter ;
-- ----------------------------
-- Triggers structure for table sys_config
-- ----------------------------
DROP TRIGGER IF EXISTS `sys_config_insert_set_user`;
delimiter ;;
CREATE TRIGGER `sys_config_insert_set_user` BEFORE INSERT ON `sys_config` FOR EACH ROW BEGIN IF @sys.ignore_sys_config_triggers != true AND NEW.set_by IS NULL THEN SET NEW.set_by = USER(); END IF; END
;;
delimiter ;
-- ----------------------------
-- Triggers structure for table sys_config
-- ----------------------------
DROP TRIGGER IF EXISTS `sys_config_update_set_user`;
delimiter ;;
CREATE TRIGGER `sys_config_update_set_user` BEFORE UPDATE ON `sys_config` FOR EACH ROW BEGIN IF @sys.ignore_sys_config_triggers != true AND NEW.set_by IS NULL THEN SET NEW.set_by = USER(); END IF; END
;;
delimiter ;
SET FOREIGN_KEY_CHECKS = 1;