Skip to content

Commit

Permalink
MDEV-18319 BIGINT UNSIGNED Performance issue
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abarkov committed Apr 9, 2024
1 parent 09bae92 commit 6606abb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mysql-test/main/func_in.result
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
21 changes: 21 additions & 0 deletions mysql-test/main/func_in.test
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand Down

0 comments on commit 6606abb

Please sign in to comment.