Server IP : 185.86.78.101 / Your IP : 216.73.216.213 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/server/mysql/mysql-test/r/ |
Upload File : |
# WL#8017 Infrastructure for Optimizer Hints # MAX_EXECUTION_TIME hint testing # MAX_EXECUTION_TIME hint testing CREATE TABLE t1 (a INT, b VARCHAR(300)); INSERT INTO t1 VALUES (1, 'string'); INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; INSERT INTO t1 SELECT * FROM t1; SELECT /*+ MAX_EXECUTION_TIME(1) */ * FROM t1 a, t1 b; ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded EXPLAIN SELECT /*+ MAX_EXECUTION_TIME(10) MAX_EXECUTION_TIME(100) */ * FROM t1; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 2048 100.00 NULL Warnings: Warning 3126 Hint MAX_EXECUTION_TIME(100) is ignored as conflicting/duplicated Note 1003 /* select#1 */ select /*+ MAX_EXECUTION_TIME(10) */ `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` DROP TABLE t1; # test the MAX_EXECUTION_TIME hint for SELECT statements: CREATE TABLE t1 (i INT, j INT); CREATE INDEX i1 ON t1(i); CREATE INDEX i2 ON t1(j); INSERT INTO t1 VALUES (1, 1), (2, 2); SELECT /*+ MAX_EXECUTION_TIME(4294967296) */ 1 FROM t1; 1 1 1 Warnings: Warning 1064 Unsupported MAX_EXECUTION_TIME near ') */ 1 FROM t1' at line 1 SELECT /*+ MAX_EXECUTION_TIME(1) */ *, SLEEP(1000) FROM t1; ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded SELECT /*+ MAX_EXECUTION_TIME(1) */ *, SLEEP(1000) FROM t1 UNION SELECT 1, 2, 3; ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded (SELECT /*+ MAX_EXECUTION_TIME(1) */ *, SLEEP(1000) FROM t1) UNION (SELECT 1, 2, 3); ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded ((SELECT /*+ MAX_EXECUTION_TIME(1) */ *, SLEEP(1000) FROM t1)); ERROR HY000: Query execution was interrupted, maximum statement execution time exceeded # only SELECT statements supports the MAX_EXECUTION_TIME hint (warning): CREATE TABLE t2 (i INT); INSERT /*+ MAX_EXECUTION_TIME(1) */ INTO t2 SELECT 1; Warnings: Warning 3125 MAX_EXECUTION_TIME hint is supported by top-level standalone SELECT statements only REPLACE /*+ MAX_EXECUTION_TIME(1) */ INTO t2 SELECT 1; Warnings: Warning 3125 MAX_EXECUTION_TIME hint is supported by top-level standalone SELECT statements only UPDATE /*+ MAX_EXECUTION_TIME(1) */ t2 SET i = 1; Warnings: Warning 3125 MAX_EXECUTION_TIME hint is supported by top-level standalone SELECT statements only DELETE /*+ MAX_EXECUTION_TIME(1) */ FROM t2 WHERE i = 1; Warnings: Warning 3125 MAX_EXECUTION_TIME hint is supported by top-level standalone SELECT statements only DROP TABLE t1, t2; SELECT 1 FROM (SELECT /*+ MAX_EXECUTION_TIME(10) */ 1) a; 1 1 Warnings: Warning 3125 MAX_EXECUTION_TIME hint is supported by top-level standalone SELECT statements only CREATE FUNCTION f1() RETURNS INT BEGIN SELECT /*+ MAX_EXECUTION_TIME(10) */ 1 INTO @a; RETURN 1; END| Warnings: Warning 3125 MAX_EXECUTION_TIME hint is supported by top-level standalone SELECT statements only DROP FUNCTION f1;