diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-05 12:15:17 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-11-05 12:15:17 +0200 |
commit | d63e19806108efc1ca8d533841ad2471f2e0c4fe (patch) | |
tree | e7f63499d0768e3af50b5c576048adbd84f4786f /sql/opt_range.cc | |
parent | 6472c5c015a174ffd680fddc8f20c7a94684a552 (diff) | |
parent | 03977e8273cbd33c3cbfec191ceee856f973ce1a (diff) | |
download | mariadb-git-d63e19806108efc1ca8d533841ad2471f2e0c4fe.tar.gz |
Merge 10.0 into 10.1
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index d8ecf8077b8..ac928c35df2 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3139,6 +3139,12 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) } + if (quick && (quick->get_type() == QUICK_SELECT_I::QS_TYPE_ROR_UNION || + quick->get_type() == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE)) + { + table->cond_selectivity*= (quick->records/table_records); + } + bitmap_union(used_fields, &handled_columns); /* Check if we can improve selectivity estimates by using sampling */ |