Commit 6606abb6 authored by Alexander Barkov's avatar Alexander Barkov

MDEV-18319 BIGINT UNSIGNED Performance issue

The patch for MDEV-18319 BIGINT UNSIGNED Performance issue
fixed this problem in 10.5.23.

This patch adds only an MTR test to cover MDEV-18319.
parent 09bae92c
......@@ -979,5 +979,29 @@ c1
9223372036854775808
drop table `a`;
#
# MDEV-18319 BIGINT UNSIGNED Performance issue
#
CREATE OR REPLACE TABLE t1 (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
);
FOR i IN 0..255
DO
INSERT INTO t1 VALUES ();
END FOR
$$
SELECT MIN(id), MAX(id), COUNT(*) FROM t1;
MIN(id) MAX(id) COUNT(*)
1 256 256
EXPLAIN SELECT id FROM t1 WHERE id IN (1,2);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL 2 Using where; Using index
DROP TABLE t1;
#
# End of 10.5 tests
#
......@@ -756,6 +756,27 @@ SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775807 );
SELECT c1 FROM a WHERE c1 IN ( 1, 9223372036854775808 );
drop table `a`;
--echo #
--echo # MDEV-18319 BIGINT UNSIGNED Performance issue
--echo #
CREATE OR REPLACE TABLE t1 (
id bigint(20) unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY
);
DELIMITER $$;
FOR i IN 0..255
DO
INSERT INTO t1 VALUES ();
END FOR
$$
DELIMITER ;$$
SELECT MIN(id), MAX(id), COUNT(*) FROM t1;
EXPLAIN SELECT id FROM t1 WHERE id IN (1,2);
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775806, 9223372036854775807);
EXPLAIN SELECT id FROM t1 WHERE id IN (9223372036854775807, 9223372036854775808);
DROP TABLE t1;
--echo #
--echo # End of 10.5 tests
--echo #
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment