mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Update matching_candidates_in_table() to treat all conditions similar
Fixed also that the 'with_found_constraint parameter' to matching_candidates_in_table() is as documented: It is now true only if there is a reference to a previous table in the WHERE condition for the current examined table (as it was originally documented) Changes in test results: - Filtered was 25% smaller for some queries (expected). - Some join order changed (probably because the tables had very few rows). - Some more table scans, probably because there would be fewer returned rows. - Some tests exposes a bug that if there is more filtered rows, then the cost for table scan will be higher. This will be fixed in a later commit.
This commit is contained in:
@ -205,13 +205,13 @@ insert into t3 values (1,1),(2,1),(1,3);
|
||||
select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
|
||||
a b a b a b
|
||||
1 1 1 1 1 1
|
||||
2 1 2 2 2 1
|
||||
1 3 1 1 1 3
|
||||
2 1 2 2 2 1
|
||||
explain select * from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
|
||||
1 SIMPLE t2 ref PRIMARY PRIMARY 4 test.t1.a 1 Using index
|
||||
1 SIMPLE t3 eq_ref PRIMARY PRIMARY 8 test.t2.b,test.t1.b 1 Using index
|
||||
1 SIMPLE t2 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index; Using join buffer (flat, BNL join)
|
||||
1 SIMPLE t3 index PRIMARY PRIMARY 8 NULL 3 Using where; Using index; Using join buffer (incremental, BNL join)
|
||||
delete t2.*,t3.* from t1,t2,t3 where t1.a=t2.a AND t2.b=t3.a and t1.b=t3.b;
|
||||
select * from t3;
|
||||
a b
|
||||
|
Reference in New Issue
Block a user