summaryrefslogtreecommitdiff
path: root/sql/opt_index_cond_pushdown.cc
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2011-01-21 18:21:55 -0800
committerIgor Babaev <igor@askmonty.org>2011-01-21 18:21:55 -0800
commit0f46efcba65a3e4f2216d7e78aa7211b270e467b (patch)
tree3124aed5792b2d4a0771eca52f9f1d2a81c5b763 /sql/opt_index_cond_pushdown.cc
parented2405788fad64d68d54bc41b508c24c60b4eecd (diff)
downloadmariadb-git-0f46efcba65a3e4f2216d7e78aa7211b270e467b.tar.gz
Post-review fixes for the patch that added the code allowing to use
hash join over equi-join conditions without supporting indexes.
Diffstat (limited to 'sql/opt_index_cond_pushdown.cc')
-rw-r--r--sql/opt_index_cond_pushdown.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/sql/opt_index_cond_pushdown.cc b/sql/opt_index_cond_pushdown.cc
index 9f6cd69663d..e0a2d3b1f30 100644
--- a/sql/opt_index_cond_pushdown.cc
+++ b/sql/opt_index_cond_pushdown.cc
@@ -26,7 +26,7 @@
FALSE No
*/
-bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
+bool uses_index_fields_only(Item *item, TABLE *tbl, uint keyno,
bool other_tbls_ok)
{
if (item->const_item())
@@ -279,15 +279,12 @@ Item *make_cond_remainder(Item *cond, bool exclude_index)
tab A join tab that has tab->table->file and its condition
in tab->select_cond
keyno Index for which extract and push the condition
- other_tbls_ok TRUE <=> Fields of other non-const tables are allowed
- factor_out TRUE <=> Factor out the extracted condition
DESCRIPTION
Try to extract and push the index condition down to table handler
*/
-void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok,
- bool factor_out)
+void push_index_cond(JOIN_TAB *tab, uint keyno)
{
DBUG_ENTER("push_index_cond");
Item *idx_cond;
@@ -320,7 +317,7 @@ void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok,
print_where(tab->select_cond, "full cond", QT_ORDINARY););
idx_cond= make_cond_for_index(tab->select_cond, tab->table, keyno,
- other_tbls_ok);
+ tab->icp_other_tables_ok);
DBUG_EXECUTE("where",
print_where(idx_cond, "idx cond", QT_ORDINARY););
@@ -339,10 +336,8 @@ void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok,
/*
if cache is used then the value is TRUE only
for BKA[_UNIQUE] cache (see check_join_cache_usage func).
- In this case other_tbls_ok is an equivalent of
- cache->is_key_access().
*/
- other_tbls_ok &&
+ tab->icp_other_tables_ok &&
(idx_cond->used_tables() &
~(tab->table->map | tab->join->const_table_map)))
tab->cache_idx_cond= idx_cond;
@@ -360,8 +355,9 @@ void push_index_cond(JOIN_TAB *tab, uint keyno, bool other_tbls_ok,
if (idx_remainder_cond != idx_cond)
tab->ref.disable_cache= TRUE;
- Item *row_cond= factor_out ? make_cond_remainder(tab->select_cond, TRUE) :
- tab->pre_idx_push_select_cond;
+ Item *row_cond= tab->idx_cond_fact_out ?
+ make_cond_remainder(tab->select_cond, TRUE) :
+ tab->pre_idx_push_select_cond;
DBUG_EXECUTE("where",
print_where(row_cond, "remainder cond", QT_ORDINARY););