[MDEV-31573] rocksdb.group_min_max test fails Created: 2023-06-28  Updated: 2023-07-04  Resolved: 2023-06-29

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.9, 10.10, 10.11, 11.0
Fix Version/s: 10.9.8, 10.10.6, 10.11.5, 11.0.3, 11.1.2, 11.2.1

Type: Bug Priority: Major
Reporter: Sergei Petrunia Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: None


 Description   

./mtr rocksdb.group_min_max consistently fails like shown above.

This test doesnt fail all over the buildbot, because

  • rocksdb suite is not run on every builder
  • the test needs a debug build

CURRENT_TEST: rocksdb.group_min_max
--- /optane/dev-git2/10.9/storage/rocksdb/mysql-test/rocksdb/r/group_min_max.result     2023-06-28 18:41:43.843236383 +0300
+++ /optane/dev-git2/10.9/storage/rocksdb/mysql-test/rocksdb/r/group_min_max.reject     2023-06-28 21:40:45.425994259 +0300
@@ -2207,19 +2207,19 @@
 explain extended select a1,a2,min(b),max(b) from t1
 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2;
 id     select_type     table   type    possible_keys   key     key_len ref     rows    filtered       Extra
-1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        130     NULL    128    99.22    Using where; Using index
+1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        130     NULL    128    98.44    Using where; Using index
 Warnings:
 Note   1003    select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`
 explain extended select a1,a2,b,min(c),max(c) from t1
 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b;
 id     select_type     table   type    possible_keys   key     key_len ref     rows    filtered       Extra
-1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_2        130     NULL    128    75.00    Using where
+1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_2        130     NULL    128    50.00    Using where
 Warnings:
 Note   1003    select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,min(`test`.`t1`.`c`) AS `min(c)`,max(`test`.`t1`.`c`) AS `max(c)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
 explain extended select a1,a2,b,c from t1
 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c;
 id     select_type     table   type    possible_keys   key     key_len ref     rows    filtered       Extra
-1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        130     NULL    128    75.00    Using where
+1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        130     NULL    128    50.00    Using where
 Warnings:
 Note   1003    select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`d` > 'xy2' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`,`test`.`t1`.`c`
 explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1;
@@ -2236,7 +2236,7 @@
 1      SIMPLE  t2      index   NULL    idx_t2_1        163     NULL    164     Using where; Using index
 explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
 id     select_type     table   type    possible_keys   key     key_len ref     rows    filtered       Extra
-1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        130     NULL    128    99.22    Using where; Using index
+1      SIMPLE  t1      range   idx_t1_0,idx_t1_1,idx_t1_2      idx_t1_1        130     NULL    128    98.44    Using where; Using index
 Warnings:
 Note   1003    select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b`
 explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;



 Comments   
Comment by Sergei Petrunia [ 2023-06-28 ]

All differences are in the "filtered" column.
The cause of the difference is different estimates from histogram.
In 10.8, the default histogram type changed from DOUBLE_PREC_HB to JSON_HB.

Generated at Thu Feb 08 10:24:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.