Bug #111696 | The end range of where clause will clear the index->search_info->hash_analysis | ||
---|---|---|---|
Submitted: | 8 Jul 2023 10:24 | Modified: | 20 Dec 2023 4:44 |
Reporter: | shengchun cao | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S5 (Performance) |
Version: | 8.0.32 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | ahi |
[8 Jul 2023 10:24]
shengchun cao
[12 Jul 2023 12:40]
MySQL Verification Team
HI Mr. cao, Thank you so much for your bug report. However, this is not a bug. This could be a feature request or performance improvement suggestion. So, if you would change the severity of this report to one of the two, we might consider it. Do note that 8.0 is now in the maintenance mode, so it will not receive new features or performance enhancements. If you change severity of this report, as described, send us also the output from the EXPLAIN statements for each of these distinct queries, so that we can make a decision. We are waiting on your feedback.
[12 Jul 2023 12:44]
MySQL Verification Team
HI Mr. cao, We have analysed further your report and concluded that it is a valid performance enhancement request. This report is now a fully verified performance request.
[12 Jul 2023 23:13]
shengchun cao
Hi, MySQL Verification Team According to your second reply, do I need to provide the output of EXPLAIN statments for each of the queries mentioned in the Step 4?
[13 Jul 2023 11:46]
MySQL Verification Team
Hi Mr. cao, Yes, that would be welcome.
[20 Dec 2023 4:44]
shengchun cao
explain of SQLs for step 4: - SQL 1(prefix of composite primary key): SELECT * FROM t_ahi WHERE i1 >= 2 AND i1 <= 10 +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+-----------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+-----------------------+ | 1 | SIMPLE | t_ahi | <null> | range | idx_i1_i2_s1_s2 | idx_i1_i2_s1_s2 | 4 | <null> | 9 | 100.0 | Using index condition | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+-----------------------+ - SQL 2(prefix of composite primary key): SELECT * FROM t_ahi WHERE i1 > 2 AND i1 < 10 +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+-----------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+-----------------------+ | 1 | SIMPLE | t_ahi | <null> | range | idx_i1_i2_s1_s2 | idx_i1_i2_s1_s2 | 4 | <null> | 1 | 100.0 | Using index condition | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+-----------------------+ - SQL 3(prefix of unique index): SELECT i1, i2, s1 FROM t_ahi WHERE s1 >= '10' AND s1 <= '20' +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+--------------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+--------------------------+ | 1 | SIMPLE | t_ahi | <null> | index | idx_i1_i2_s1_s2 | idx_i1_i2_s1_s2 | 204 | <null> | 27 | 11.11 | Using where; Using index | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+--------------------------+ - SQL 4(prefix of unique index): SELECT i1, i2, s1 FROM t_ahi WHERE s1 > '10' AND s1 < '20' +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+--------------------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+--------------------------+ | 1 | SIMPLE | t_ahi | <null> | index | idx_i1_i2_s1_s2 | idx_i1_i2_s1_s2 | 204 | <null> | 27 | 11.11 | Using where; Using index | +----+-------------+-------+------------+-------+-----------------+-----------------+---------+--------+------+----------+--------------------------+ - SQL 5(whole of non-unique index): SELECT i1, i2, i3 FROM t_ahi WHERE i3 = 20 +----+-------------+-------+------------+------+---------------+--------+---------+--------+------+----------+-------------+ | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra | +----+-------------+-------+------------+------+---------------+--------+---------+--------+------+----------+-------------+ | 1 | SIMPLE | t_ahi | <null> | ALL | <null> | <null> | <null> | <null> | 27 | 10.0 | Using where | +----+-------------+-------+------------+------+---------------+--------+---------+--------+------+----------+-------------+
[20 Dec 2023 12:06]
MySQL Verification Team
Thank you, Mr. cao.