You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: mysql-test/main/null_aware_cardinality.result
-16Lines changed: 0 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,3 @@
1
-
SET @session_start_value = @@new_mode;
2
1
# Small driving table
3
2
CREATE TABLE t1 (a INT, b INT);
4
3
INSERT INTO t1 VALUES (1, 1), (2, 2000),(3,300);
@@ -14,9 +13,6 @@ ANALYZE TABLE t2 PERSISTENT FOR ALL;
14
13
Table Op Msg_type Msg_text
15
14
test.t2 analyze status Engine-independent statistics collected
16
15
test.t2 analyze status Table is already up to date
17
-
SET @@new_mode = "FIX_INDEX_STATS_FOR_ALL_NULLS";
18
-
Warnings:
19
-
Warning 4200 The setting 'new_mode=FIX_INDEX_STATS_FOR_ALL_NULLS' is ignored. It only exists for compatibility with old installations and will be removed in a future release
20
16
# NULL-rejecting equality t1.b = t2.b will not return any matches
21
17
# because all values of t2.b are NULL. So "rows" = 1 for t2 where 1 is
22
18
# a special value meaning "very few" rows
@@ -82,23 +78,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
82
78
1 SIMPLE t3 ref key_ab key_ab 10 test.t1.a,const 11 100.00 Using where; Using index
83
79
Warnings:
84
80
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`a` and `test`.`t3`.`b` is null
85
-
# In the old mode (null-aware estimation is not enabled), "rows" > 1
86
-
SET @@new_mode = "";
87
-
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t2 ON t1.a = t2.a AND t1.b = t2.b;
88
-
id select_type table type possible_keys key key_len ref rows filtered Extra
89
-
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
90
-
1 SIMPLE t2 ref key_b key_b 5 test.t1.b 100 100.00 Using where
91
-
Warnings:
92
-
Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t2`.`b` = `test`.`t1`.`b`
93
81
# Insert some non-NULL values and re-collect the stats
94
82
INSERT INTO t3 SELECT 1, 1 FROM seq_1_to_100;
95
83
ANALYZE TABLE t3 PERSISTENT FOR COLUMNS (b) INDEXES (key_ab);
96
84
Table Op Msg_type Msg_text
97
85
test.t3 analyze status Engine-independent statistics collected
98
86
test.t3 analyze status OK
99
-
SET @@new_mode = "FIX_INDEX_STATS_FOR_ALL_NULLS";
100
-
Warnings:
101
-
Warning 4200 The setting 'new_mode=FIX_INDEX_STATS_FOR_ALL_NULLS' is ignored. It only exists for compatibility with old installations and will be removed in a future release
102
87
EXPLAIN EXTENDED SELECT * FROM t1 JOIN t3 ON t1.a = t3.a AND t1.b = t3.b;
103
88
id select_type table type possible_keys key key_len ref rows filtered Extra
104
89
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where
@@ -158,5 +143,4 @@ EXPLAIN SELECT * FROM t1, t2 WHERE t2.a=t1.a AND t2.b=t1.a;
158
143
id select_type table type possible_keys key key_len ref rows Extra
159
144
1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where
160
145
1 SIMPLE t2 ref i1 i1 66 test.t1.a,test.t1.a 1 Using where
0 commit comments