Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
N/A
-
None
Description
For a complicated query, INDEX_STATISTICS.QUERIES introduced in MDEV-33152 can be incremented more than once. The query in the test case is somewhat degenerate, it just demonstrates the general idea.
SET @userstat.save= @@userstat; |
set global userstat= 1; |
|
create or replace table t (a int, key(a)) engine=MyISAM; |
insert into t values (1),(2),(3),(4); |
|
flush index_statistics;
|
select a from t where a in ( select a from t ); |
show index_statistics;
|
|
# Cleanup
|
drop table t; |
set global userstat= @userstat.save; |
bb-11.5-MDEV-33152-index-statistics 802e89b176efd8ef995cdd456a04ac6452f0e284 |
MariaDB [test]> flush index_statistics;
|
Query OK, 0 rows affected (0.000 sec) |
|
MariaDB [test]> select a from t where a in ( select a from t ); |
+------+ |
| a |
|
+------+ |
| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
+------+ |
4 rows in set (0.001 sec) |
|
MariaDB [test]> show index_statistics;
|
+--------------+------------+------------+-----------+---------+ |
| Table_schema | Table_name | Index_name | Rows_read | Queries |
|
+--------------+------------+------------+-----------+---------+ |
| test | t | a | 8 | 2 |
|
+--------------+------------+------------+-----------+---------+ |
1 row in set (0.001 sec) |
Attachments
Issue Links
- is caused by
-
MDEV-33152 Add QUERIES to INDEX_STATISTICS
- Closed