summaryrefslogtreecommitdiff
path: root/mysql-test/main/opt_trace_index_merge_innodb.result
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-01-19 18:34:45 +0200
committerMonty <monty@mariadb.org>2022-01-19 18:49:53 +0200
commitfdec8852014960b33b302fc2467cc535eff78186 (patch)
tree856e583ce84eee84732b91f2a3ccb8c0ebf9b3b3 /mysql-test/main/opt_trace_index_merge_innodb.result
parentc75bee9478f4f2d458d3522a4bd496b95e118498 (diff)
downloadmariadb-git-fdec8852014960b33b302fc2467cc535eff78186.tar.gz
MDEV-25830 optimizer_use_condition_selectivity=4 sometimes produces worse plan than optimizer_use_condition_selectivity=1
The issue was that calc_cond_selectivity_for_table prefered ranges with many parts and when deciding on which selectivity to use. Fixed by going through ranges according to the number of rows in the range. This ensures that selectivity from ranges with few rows will be prefered over ranges with many rows for indexes that uses the same columns.
Diffstat (limited to 'mysql-test/main/opt_trace_index_merge_innodb.result')
-rw-r--r--mysql-test/main/opt_trace_index_merge_innodb.result8
1 files changed, 4 insertions, 4 deletions
diff --git a/mysql-test/main/opt_trace_index_merge_innodb.result b/mysql-test/main/opt_trace_index_merge_innodb.result
index 97c2c262bfc..5786f741996 100644
--- a/mysql-test/main/opt_trace_index_merge_innodb.result
+++ b/mysql-test/main/opt_trace_index_merge_innodb.result
@@ -184,12 +184,12 @@ explain select * from t1 where pk1 != 0 and key1 = 1 {
{
"selectivity_for_indexes": [
{
- "index_name": "PRIMARY",
- "selectivity_from_index": 1
- },
- {
"index_name": "key1",
"selectivity_from_index": 0.001
+ },
+ {
+ "index_name": "PRIMARY",
+ "selectivity_from_index": 1
}
],
"selectivity_for_columns": [],