64 changed files with 2015 additions and 574 deletions
-
23btr/btr0cur.c
-
10buf/buf0buf.c
-
2buf/buf0flu.c
-
8data/data0data.c
-
15dict/dict0crea.c
-
60dict/dict0dict.c
-
86dict/dict0load.c
-
1dict/dict0mem.c
-
20fil/fil0fil.c
-
26handler/ha_innodb.cc
-
4handler/ha_innodb.h
-
314handler/handler0alter.cc
-
3include/buf0buf.h
-
2include/db0err.h
-
13include/dict0dict.h
-
26include/dict0dict.ic
-
7include/dict0load.h
-
42include/dict0mem.h
-
3include/fil0fil.h
-
7include/lock0lock.h
-
6include/lock0lock.ic
-
2include/mtr0mtr.ic
-
13include/os0file.h
-
3include/os0file.ic
-
19include/page0page.h
-
23include/page0page.ic
-
14include/rem0rec.h
-
41include/rem0rec.ic
-
20include/rem0types.h
-
13include/row0ext.h
-
9include/row0ext.ic
-
30include/row0row.h
-
36include/row0row.ic
-
4include/univ.i
-
151lock/lock0lock.c
-
8log/log0log.c
-
4log/log0recv.c
-
13mtr/mtr0mtr.c
-
44os/os0file.c
-
22page/page0page.c
-
2page/page0zip.c
-
109percona-suite/percona_mysqldump_innodb_optimize_keys.result
-
62percona-suite/percona_mysqldump_innodb_optimize_keys.test
-
88percona-suite/percona_query_cache_with_comments.inc.backup
-
66percona-suite/percona_query_response_time-replication.result
-
61percona-suite/percona_query_response_time-replication.test
-
306percona-suite/percona_query_response_time-stored.result
-
85percona-suite/percona_query_response_time-stored.test
-
377percona-suite/percona_query_response_time.result
-
71percona-suite/percona_query_response_time.test
-
1percona-suite/percona_query_response_time_flush.inc
-
8percona-suite/percona_query_response_time_show.inc
-
19percona-suite/percona_query_response_time_sleep.inc
-
2rem/rem0rec.c
-
19row/row0ext.c
-
13row/row0mysql.c
-
48row/row0row.c
-
11row/row0sel.c
-
4row/row0upd.c
-
18row/row0vers.c
-
4srv/srv0srv.c
-
63trx/trx0rec.c
-
3trx/trx0undo.c
-
2ut/ut0ut.c
@ -1,109 +0,0 @@ |
|||||
# |
|
||||
# Test the --innodb-optimize-keys option. |
|
||||
# |
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, KEY(b)) ENGINE=MyISAM; |
|
||||
###################################### |
|
||||
|
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
|
||||
/*!40101 SET NAMES utf8 */; |
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
|
||||
/*!40103 SET TIME_ZONE='+00:00' */; |
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; |
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
|
||||
DROP TABLE IF EXISTS `t1`; |
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */; |
|
||||
/*!40101 SET character_set_client = utf8 */; |
|
||||
CREATE TABLE `t1` ( |
|
||||
`a` int(11) NOT NULL, |
|
||||
`b` int(11) DEFAULT NULL, |
|
||||
PRIMARY KEY (`a`), |
|
||||
KEY `b` (`b`) |
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1; |
|
||||
/*!40101 SET character_set_client = @saved_cs_client */; |
|
||||
|
|
||||
LOCK TABLES `t1` WRITE; |
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; |
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; |
|
||||
UNLOCK TABLES; |
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
|
||||
|
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; |
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
|
||||
|
|
||||
###################################### |
|
||||
DROP TABLE t1; |
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; |
|
||||
INSERT INTO t2 VALUES (0), (1), (2); |
|
||||
CREATE TABLE t1 ( |
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, |
|
||||
a INT, b VARCHAR(255), c DECIMAL(10,3), |
|
||||
KEY (b), |
|
||||
UNIQUE KEY uniq(c,a), |
|
||||
FOREIGN KEY (a) REFERENCES t2(a) ON DELETE CASCADE |
|
||||
) ENGINE=InnoDB; |
|
||||
INSERT INTO t1(a,b,c) VALUES (0, "0", 0.0), (1, "1", 1.1), (2, "2", 2.2); |
|
||||
###################################### |
|
||||
|
|
||||
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; |
|
||||
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; |
|
||||
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; |
|
||||
/*!40101 SET NAMES utf8 */; |
|
||||
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; |
|
||||
/*!40103 SET TIME_ZONE='+00:00' */; |
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; |
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; |
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; |
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; |
|
||||
DROP TABLE IF EXISTS `t1`; |
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */; |
|
||||
/*!40101 SET character_set_client = utf8 */; |
|
||||
CREATE TABLE `t1` ( |
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|
||||
`a` int(11) DEFAULT NULL, |
|
||||
`b` varchar(255) DEFAULT NULL, |
|
||||
`c` decimal(10,3) DEFAULT NULL, |
|
||||
PRIMARY KEY (`id`) |
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; |
|
||||
/*!40101 SET character_set_client = @saved_cs_client */; |
|
||||
|
|
||||
LOCK TABLES `t1` WRITE; |
|
||||
/*!40000 ALTER TABLE `t1` DISABLE KEYS */; |
|
||||
INSERT INTO `t1` VALUES (1,0,'0',0.000),(2,1,'1',1.100),(3,2,'2',2.200); |
|
||||
ALTER TABLE `t1` ADD UNIQUE KEY `uniq` (`c`,`a`), ADD KEY `b` (`b`), ADD KEY `a` (`a`), ADD CONSTRAINT `t1_ibfk_1` FOREIGN KEY (`a`) REFERENCES `t2` (`a`) ON DELETE CASCADE; |
|
||||
/*!40000 ALTER TABLE `t1` ENABLE KEYS */; |
|
||||
UNLOCK TABLES; |
|
||||
DROP TABLE IF EXISTS `t2`; |
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */; |
|
||||
/*!40101 SET character_set_client = utf8 */; |
|
||||
CREATE TABLE `t2` ( |
|
||||
`a` int(11) NOT NULL, |
|
||||
PRIMARY KEY (`a`) |
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
|
||||
/*!40101 SET character_set_client = @saved_cs_client */; |
|
||||
|
|
||||
LOCK TABLES `t2` WRITE; |
|
||||
/*!40000 ALTER TABLE `t2` DISABLE KEYS */; |
|
||||
INSERT INTO `t2` VALUES (0),(1),(2); |
|
||||
/*!40000 ALTER TABLE `t2` ENABLE KEYS */; |
|
||||
UNLOCK TABLES; |
|
||||
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; |
|
||||
|
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; |
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; |
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; |
|
||||
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; |
|
||||
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; |
|
||||
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
|
||||
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; |
|
||||
|
|
||||
###################################### |
|
||||
DROP TABLE t1, t2; |
|
@ -1,62 +0,0 @@ |
|||||
# Embedded server doesn't support external clients |
|
||||
--source include/not_embedded.inc |
|
||||
|
|
||||
# Fast index creation is only available in InnoDB plugin |
|
||||
--source include/have_innodb.inc |
|
||||
|
|
||||
# Save the initial number of concurrent sessions |
|
||||
--source include/count_sessions.inc |
|
||||
|
|
||||
--echo # |
|
||||
--echo # Test the --innodb-optimize-keys option. |
|
||||
--echo # |
|
||||
|
|
||||
--let $file=$MYSQLTEST_VARDIR/tmp/t1.sql |
|
||||
|
|
||||
# First test that the option has no effect on non-InnoDB tables |
|
||||
|
|
||||
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, KEY(b)) ENGINE=MyISAM; |
|
||||
|
|
||||
--exec $MYSQL_DUMP --skip-comments --innodb-optimize-keys test t1 >$file |
|
||||
|
|
||||
--echo ###################################### |
|
||||
--cat_file $file |
|
||||
--echo ###################################### |
|
||||
|
|
||||
--remove_file $file |
|
||||
|
|
||||
DROP TABLE t1; |
|
||||
|
|
||||
|
|
||||
# Check that for InnoDB tables secondary and foreign keys are created |
|
||||
# after the data is dumped |
|
||||
|
|
||||
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; |
|
||||
INSERT INTO t2 VALUES (0), (1), (2); |
|
||||
|
|
||||
CREATE TABLE t1 ( |
|
||||
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, |
|
||||
a INT, b VARCHAR(255), c DECIMAL(10,3), |
|
||||
KEY (b), |
|
||||
UNIQUE KEY uniq(c,a), |
|
||||
FOREIGN KEY (a) REFERENCES t2(a) ON DELETE CASCADE |
|
||||
) ENGINE=InnoDB; |
|
||||
|
|
||||
INSERT INTO t1(a,b,c) VALUES (0, "0", 0.0), (1, "1", 1.1), (2, "2", 2.2); |
|
||||
|
|
||||
--exec $MYSQL_DUMP --skip-comments --innodb-optimize-keys test t1 t2 >$file |
|
||||
|
|
||||
--echo ###################################### |
|
||||
--cat_file $file |
|
||||
--echo ###################################### |
|
||||
|
|
||||
# Check that the resulting dump can be imported back |
|
||||
|
|
||||
--exec $MYSQL test < $file |
|
||||
|
|
||||
--remove_file $file |
|
||||
|
|
||||
DROP TABLE t1, t2; |
|
||||
|
|
||||
# Wait till we reached the initial number of concurrent sessions |
|
||||
--source include/wait_until_count_sessions.inc |
|
@ -0,0 +1,88 @@ |
|||||
|
--source include/percona_query_cache_with_comments_clear.inc |
||||
|
let $query=/* with comment first */select * from t1; |
||||
|
eval $query; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=# with comment first |
||||
|
select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=-- with comment first |
||||
|
select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=/* with comment first and "quote" */select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=# with comment first and "quote" |
||||
|
select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=-- with comment first and "quote" |
||||
|
select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query= |
||||
|
/* with comment and whitespaces first */select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query= |
||||
|
# with comment and whitespaces first |
||||
|
select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query= |
||||
|
-- with comment and whitespaces first |
||||
|
select * from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $internal=* internal comment *; |
||||
|
|
||||
|
let $query=select * /$internal/ from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
let $query=select */$internal/ from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
let $query=select */$internal/from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $internal=* internal comment with "quote" *; |
||||
|
|
||||
|
let $query=select * /$internal/ from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
let $query=select */$internal/ from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
let $query=select */$internal/from t1; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 |
||||
|
; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 ; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 ; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 |
||||
|
/* comment in the end */; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 |
||||
|
/* comment in the end */ |
||||
|
; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 #comment in the end; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 #comment in the end |
||||
|
; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 -- comment in the end; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
||||
|
|
||||
|
let $query=select * from t1 -- comment in the end |
||||
|
; |
||||
|
--source include/percona_query_cache_with_comments_eval.inc |
@ -0,0 +1,66 @@ |
|||||
|
include/master-slave.inc |
||||
|
[connection master] |
||||
|
DROP TABLE IF EXISTS t; |
||||
|
CREATE TABLE t(id INT); |
||||
|
SELECT * from t; |
||||
|
id |
||||
|
SELECT * from t; |
||||
|
id |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; |
||||
|
Warnings: |
||||
|
Warning 1292 Truncated incorrect query_response_time_range_base value: '1' |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 10 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON; |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
Warnings: |
||||
|
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
0 |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
Warnings: |
||||
|
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
0 |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
2 |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
3 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
Warnings: |
||||
|
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
0 |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
Warnings: |
||||
|
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
0 |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
2 |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) |
||||
|
3 |
||||
|
DROP TABLE IF EXISTS t; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF; |
||||
|
STOP SLAVE; |
||||
|
include/wait_for_slave_to_stop.inc |
@ -0,0 +1,61 @@ |
|||||
|
--source include/have_response_time_distribution.inc |
||||
|
--source include/master-slave.inc |
||||
|
--source include/have_binlog_format_statement.inc |
||||
|
--source include/have_debug.inc |
||||
|
--disable_query_log |
||||
|
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement:"); |
||||
|
--enable_query_log |
||||
|
|
||||
|
connection master; |
||||
|
-- disable_warnings |
||||
|
DROP TABLE IF EXISTS t; |
||||
|
-- enable_warnings |
||||
|
CREATE TABLE t(id INT); |
||||
|
SELECT * from t; |
||||
|
|
||||
|
sync_slave_with_master; |
||||
|
|
||||
|
connection slave; |
||||
|
SELECT * from t; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=ON; |
||||
|
|
||||
|
connection master; |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
sync_slave_with_master; |
||||
|
|
||||
|
connection slave; |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
|
||||
|
connection master; |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
INSERT INTO t SELECT SLEEP(0.4); |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
sync_slave_with_master; |
||||
|
|
||||
|
connection slave; |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SELECT SUM(INFORMATION_SCHEMA.QUERY_RESPONSE_TIME.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
|
||||
|
connection master; |
||||
|
DROP TABLE IF EXISTS t; |
||||
|
sync_slave_with_master; |
||||
|
connection slave; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=OFF; |
||||
|
|
||||
|
STOP SLAVE; |
||||
|
-- source include/wait_for_slave_to_stop.inc |
@ -0,0 +1,306 @@ |
|||||
|
SET GLOBAL debug="d,query_exec_time_debug"; |
||||
|
CREATE FUNCTION test_f() |
||||
|
RETURNS CHAR(30) DETERMINISTIC |
||||
|
BEGIN |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
RETURN 'Hello, world!'; |
||||
|
END/ |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; |
||||
|
Warnings: |
||||
|
Warning 1292 Truncated incorrect query_response_time_range_base value: '1' |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
44 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000003 |
||||
|
0.000007 |
||||
|
0.000015 |
||||
|
0.000030 |
||||
|
0.000061 |
||||
|
0.000122 |
||||
|
0.000244 |
||||
|
0.000488 |
||||
|
0.000976 |
||||
|
0.001953 |
||||
|
0.003906 |
||||
|
0.007812 |
||||
|
0.015625 |
||||
|
0.031250 |
||||
|
0.062500 |
||||
|
0.125000 |
||||
|
0.250000 |
||||
|
0.500000 |
||||
|
1.000000 |
||||
|
2.000000 |
||||
|
4.000000 |
||||
|
8.000000 |
||||
|
16.000000 |
||||
|
32.000000 |
||||
|
64.000000 |
||||
|
128.000000 |
||||
|
256.000000 |
||||
|
512.000000 |
||||
|
1024.000000 |
||||
|
2048.000000 |
||||
|
4096.000000 |
||||
|
8192.000000 |
||||
|
16384.000000 |
||||
|
32768.000000 |
||||
|
65536.000000 |
||||
|
131072.000000 |
||||
|
262144.000000 |
||||
|
524288.000000 |
||||
|
1048576.00000 |
||||
|
2097152.00000 |
||||
|
4194304.00000 |
||||
|
8388608.00000 |
||||
|
TOO LONG |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
4 4 4 1 44 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
44 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000003 |
||||
|
0.000007 |
||||
|
0.000015 |
||||
|
0.000030 |
||||
|
0.000061 |
||||
|
0.000122 |
||||
|
0.000244 |
||||
|
0.000488 |
||||
|
0.000976 |
||||
|
0.001953 |
||||
|
0.003906 |
||||
|
0.007812 |
||||
|
0.015625 |
||||
|
0.031250 |
||||
|
0.062500 |
||||
|
0.125000 |
||||
|
0.250000 |
||||
|
0.500000 |
||||
|
1.000000 |
||||
|
2.000000 |
||||
|
4.000000 |
||||
|
8.000000 |
||||
|
16.000000 |
||||
|
32.000000 |
||||
|
64.000000 |
||||
|
128.000000 |
||||
|
256.000000 |
||||
|
512.000000 |
||||
|
1024.000000 |
||||
|
2048.000000 |
||||
|
4096.000000 |
||||
|
8192.000000 |
||||
|
16384.000000 |
||||
|
32768.000000 |
||||
|
65536.000000 |
||||
|
131072.000000 |
||||
|
262144.000000 |
||||
|
524288.000000 |
||||
|
1048576.00000 |
||||
|
2097152.00000 |
||||
|
4194304.00000 |
||||
|
8388608.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 10 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
1 1 1 1 14 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
14 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000010 |
||||
|
0.000100 |
||||
|
0.001000 |
||||
|
0.010000 |
||||
|
0.100000 |
||||
|
1.000000 |
||||
|
10.000000 |
||||
|
100.000000 |
||||
|
1000.000000 |
||||
|
10000.000000 |
||||
|
100000.000000 |
||||
|
1000000.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 10 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 7 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
1 1 1 1 17 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
17 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000008 |
||||
|
0.000059 |
||||
|
0.000416 |
||||
|
0.002915 |
||||
|
0.020408 |
||||
|
0.142857 |
||||
|
1.000000 |
||||
|
7.000000 |
||||
|
49.000000 |
||||
|
343.000000 |
||||
|
2401.000000 |
||||
|
16807.000000 |
||||
|
117649.000000 |
||||
|
823543.000000 |
||||
|
5764801.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 7 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 156 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
1 1 1 1 7 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
7 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000041 |
||||
|
0.006410 |
||||
|
1.000000 |
||||
|
156.000000 |
||||
|
24336.000000 |
||||
|
3796416.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 156 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 1000 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
test_f() |
||||
|
Hello, world! |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
1 1 1 1 6 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
6 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.001000 |
||||
|
1.000000 |
||||
|
1000.000000 |
||||
|
1000000.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 1000 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001; |
||||
|
Warnings: |
||||
|
Warning 1292 Truncated incorrect query_response_time_range_base value: '1001' |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 1000 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; |
||||
|
DROP FUNCTION test_f; |
||||
|
SET GLOBAL debug=default; |
@ -0,0 +1,85 @@ |
|||||
|
--source include/have_response_time_distribution.inc |
||||
|
--source include/have_debug.inc |
||||
|
|
||||
|
SET GLOBAL debug="d,query_exec_time_debug"; |
||||
|
|
||||
|
delimiter /; |
||||
|
CREATE FUNCTION test_f() |
||||
|
RETURNS CHAR(30) DETERMINISTIC |
||||
|
BEGIN |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
RETURN 'Hello, world!'; |
||||
|
END/ |
||||
|
delimiter ;/ |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
SELECT test_f(); |
||||
|
SELECT test_f(); |
||||
|
SELECT test_f(); |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SELECT test_f(); |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; |
||||
|
|
||||
|
DROP FUNCTION test_f; |
||||
|
|
||||
|
SET GLOBAL debug=default; |
@ -0,0 +1,377 @@ |
|||||
|
SET GLOBAL debug="d,query_exec_time_debug"; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; |
||||
|
Warnings: |
||||
|
Warning 1292 Truncated incorrect query_response_time_range_base value: '1' |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
44 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000003 |
||||
|
0.000007 |
||||
|
0.000015 |
||||
|
0.000030 |
||||
|
0.000061 |
||||
|
0.000122 |
||||
|
0.000244 |
||||
|
0.000488 |
||||
|
0.000976 |
||||
|
0.001953 |
||||
|
0.003906 |
||||
|
0.007812 |
||||
|
0.015625 |
||||
|
0.031250 |
||||
|
0.062500 |
||||
|
0.125000 |
||||
|
0.250000 |
||||
|
0.500000 |
||||
|
1.000000 |
||||
|
2.000000 |
||||
|
4.000000 |
||||
|
8.000000 |
||||
|
16.000000 |
||||
|
32.000000 |
||||
|
64.000000 |
||||
|
128.000000 |
||||
|
256.000000 |
||||
|
512.000000 |
||||
|
1024.000000 |
||||
|
2048.000000 |
||||
|
4096.000000 |
||||
|
8192.000000 |
||||
|
16384.000000 |
||||
|
32768.000000 |
||||
|
65536.000000 |
||||
|
131072.000000 |
||||
|
262144.000000 |
||||
|
524288.000000 |
||||
|
1048576.00000 |
||||
|
2097152.00000 |
||||
|
4194304.00000 |
||||
|
8388608.00000 |
||||
|
TOO LONG |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SET SESSION debug="+d,query_exec_time_0.31"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.32"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.33"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.34"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.35"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.36"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.37"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.38"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.39"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.2"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.5"; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
10 19 15 4 44 |
||||
|
1 19 15 4 44 |
||||
|
5 19 15 4 44 |
||||
|
3 19 15 4 44 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
44 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000003 |
||||
|
0.000007 |
||||
|
0.000015 |
||||
|
0.000030 |
||||
|
0.000061 |
||||
|
0.000122 |
||||
|
0.000244 |
||||
|
0.000488 |
||||
|
0.000976 |
||||
|
0.001953 |
||||
|
0.003906 |
||||
|
0.007812 |
||||
|
0.015625 |
||||
|
0.031250 |
||||
|
0.062500 |
||||
|
0.125000 |
||||
|
0.250000 |
||||
|
0.500000 |
||||
|
1.000000 |
||||
|
2.000000 |
||||
|
4.000000 |
||||
|
8.000000 |
||||
|
16.000000 |
||||
|
32.000000 |
||||
|
64.000000 |
||||
|
128.000000 |
||||
|
256.000000 |
||||
|
512.000000 |
||||
|
1024.000000 |
||||
|
2048.000000 |
||||
|
4096.000000 |
||||
|
8192.000000 |
||||
|
16384.000000 |
||||
|
32768.000000 |
||||
|
65536.000000 |
||||
|
131072.000000 |
||||
|
262144.000000 |
||||
|
524288.000000 |
||||
|
1048576.00000 |
||||
|
2097152.00000 |
||||
|
4194304.00000 |
||||
|
8388608.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 2 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 10 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SET SESSION debug="+d,query_exec_time_0.31"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.32"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.33"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.34"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.35"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.36"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.37"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.38"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.39"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.2"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.5"; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
11 19 17 2 14 |
||||
|
8 19 17 2 14 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
14 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000010 |
||||
|
0.000100 |
||||
|
0.001000 |
||||
|
0.010000 |
||||
|
0.100000 |
||||
|
1.000000 |
||||
|
10.000000 |
||||
|
100.000000 |
||||
|
1000.000000 |
||||
|
10000.000000 |
||||
|
100000.000000 |
||||
|
1000000.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 10 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 7 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SET SESSION debug="+d,query_exec_time_0.31"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.32"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.33"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.34"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.35"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.36"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.37"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.38"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.39"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.2"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.5"; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
11 19 17 2 17 |
||||
|
8 19 17 2 17 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
17 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.000008 |
||||
|
0.000059 |
||||
|
0.000416 |
||||
|
0.002915 |
||||
|
0.020408 |
||||
|
0.142857 |
||||
|
1.000000 |
||||
|
7.000000 |
||||
|
49.000000 |
||||
|
343.000000 |
||||
|
2401.000000 |
||||
|
16807.000000 |
||||
|
117649.000000 |
||||
|
823543.000000 |
||||
|
5764801.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 7 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 156 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SET SESSION debug="+d,query_exec_time_0.31"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.32"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.33"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.34"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.35"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.36"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.37"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.38"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.39"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.2"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.5"; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
11 19 17 2 7 |
||||
|
8 19 17 2 7 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
7 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000041 |
||||
|
0.006410 |
||||
|
1.000000 |
||||
|
156.000000 |
||||
|
24336.000000 |
||||
|
3796416.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 156 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 1000 |
||||
|
FLUSH QUERY_RESPONSE_TIME; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
SET SESSION debug="+d,query_exec_time_0.31"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.32"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.33"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.34"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.35"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.36"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.37"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.38"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.39"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.2"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.5"; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
count query_count query_total not_zero_region_count region_count |
||||
|
11 19 17 2 6 |
||||
|
8 19 17 2 6 |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
region_count |
||||
|
6 |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
time |
||||
|
0.000001 |
||||
|
0.001000 |
||||
|
1.000000 |
||||
|
1000.000000 |
||||
|
1000000.00000 |
||||
|
TOO LONG |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 1000 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001; |
||||
|
Warnings: |
||||
|
Warning 1292 Truncated incorrect query_response_time_range_base value: '1001' |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
Variable_name Value |
||||
|
query_response_time_range_base 1000 |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; |
||||
|
SET GLOBAL debug=default; |
@ -0,0 +1,71 @@ |
|||||
|
--source include/have_response_time_distribution.inc |
||||
|
--source include/have_debug.inc |
||||
|
|
||||
|
SET GLOBAL debug="d,query_exec_time_debug"; |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 2; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
source include/percona_query_response_time_sleep.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 10; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
source include/percona_query_response_time_sleep.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 7; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
source include/percona_query_response_time_sleep.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 156; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
source include/percona_query_response_time_sleep.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1000; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
source include/percona_query_response_time_flush.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=1; |
||||
|
source include/percona_query_response_time_sleep.inc; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
|
||||
|
source include/percona_query_response_time_show.inc; |
||||
|
|
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE = 1001; |
||||
|
SHOW GLOBAL VARIABLES where Variable_name like 'QUERY_RESPONSE_TIME_RANGE_BASE'; |
||||
|
|
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_STATS=0; |
||||
|
SET GLOBAL QUERY_RESPONSE_TIME_RANGE_BASE =10; |
||||
|
|
||||
|
SET GLOBAL debug=default; |
@ -0,0 +1 @@ |
|||||
|
FLUSH QUERY_RESPONSE_TIME; |
@ -0,0 +1,8 @@ |
|||||
|
SELECT d.count, |
||||
|
(SELECT SUM(a.count) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as a WHERE a.count != 0) as query_count, |
||||
|
(SELECT SUM((b.total * 1000000) DIV 1000000) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as b WHERE b.count != 0) as query_total, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as c WHERE c.count != 0) as not_zero_region_count, |
||||
|
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME) as region_count |
||||
|
FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME as d WHERE d.count > 0; |
||||
|
SELECT COUNT(*) as region_count FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
||||
|
SELECT time FROM INFORMATION_SCHEMA.QUERY_RESPONSE_TIME; |
@ -0,0 +1,19 @@ |
|||||
|
SET SESSION debug="+d,query_exec_time_0.31"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.32"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.33"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.34"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.35"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.36"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.37"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.38"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.39"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.2"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_1.4"; |
||||
|
SET SESSION debug="+d,query_exec_time_0.5"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.1"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.3"; |
||||
|
SET SESSION debug="+d,query_exec_time_2.5"; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue