diff options
author | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-11-02 08:46:04 +0200 |
---|---|---|
committer | Jan Lindström <jan.lindstrom@mariadb.com> | 2018-11-02 08:46:04 +0200 |
commit | c2caca02ac39454e18db8de563e7e7c8eaf8b1c7 (patch) | |
tree | b340a4f6b67f7a43e4c8885ea9d634ef89e0edcc /sql | |
parent | b9a69f776d3dea825bc23759660258c28bf58cc7 (diff) | |
parent | 9eb8a46790c556a9f683a14aea71e775f4fbe802 (diff) | |
download | mariadb-git-c2caca02ac39454e18db8de563e7e7c8eaf8b1c7.tar.gz |
Merge remote-tracking branch 'origin/10.0' into 10.0-galera
Diffstat (limited to 'sql')
-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 0fd2cd267fc..3bcaa72e32f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -3725,6 +3725,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 */ |