File: pt-143.sql

package info (click to toggle)
percona-toolkit 3.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 68,916 kB
  • sloc: perl: 241,287; sql: 22,868; sh: 19,746; javascript: 6,799; makefile: 353; awk: 38; python: 30; sed: 1
file content (33 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
DROP SCHEMA IF EXISTS test;
CREATE SCHEMA test;

CREATE TABLE test.`stats_r` (
`id` int(10) unsigned NOT NULL,
`end` datetime NOT NULL,
`start` datetime NOT NULL,
`sum_value` float DEFAULT NULL,
`user_id` varchar(100) NOT NULL DEFAULT '',
`interval` int(10) unsigned NOT NULL DEFAULT '0',
`mean` float DEFAULT NULL,
`max` float DEFAULT NULL,
`min` float DEFAULT NULL,
PRIMARY KEY (`id`,`start`,`end`,`user_id`(13),`interval`),
KEY `cid_start_end` (`user_id`(13),`start`,`end`)
) ENGINE=MyISAM;

CREATE TABLE test.stats_s LIKE test.stats_r;

INSERT INTO `test`.`stats_r`
(`id`,`end`,`start`,`sum_value`,`user_id`,`interval`,`mean`,`max`,`min`)
VALUES
(1,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(2,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(3,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(4,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(5,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(6,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(7,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(8,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(9,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1),
(10,now() + INTERVAL 1 hour, NOW(), 1,1,1,1,1,1);