summaryrefslogtreecommitdiff
path: root/sql/opt_subselect.h
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-09-03 12:58:41 +0200
committerSergei Golubchik <serg@mariadb.org>2015-09-03 12:58:41 +0200
commit530a6e74819ec14b5fdc42aa588b236ecb9f2fcd (patch)
treea4d45b1fd0e434c23577507364fa443226676eb5 /sql/opt_subselect.h
parent5088cbf4ed7224698678f3eaf406361c6e7db4b8 (diff)
parent4b41e3c7f33714186c97a6cc2e6d3bb93b050c61 (diff)
downloadmariadb-git-530a6e74819ec14b5fdc42aa588b236ecb9f2fcd.tar.gz
Merge branch '10.0' into 10.1
referenced_by_foreign_key2(), needed for InnoDB to compile, was taken from 10.0-galera
Diffstat (limited to 'sql/opt_subselect.h')
-rw-r--r--sql/opt_subselect.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h
index a2f6b644bf2..8daa973f825 100644
--- a/sql/opt_subselect.h
+++ b/sql/opt_subselect.h
@@ -195,8 +195,6 @@ public:
PREV_BITS(key_part_map, max_loose_keypart+1) && // (3)
!key_uses_partial_cols(s->table->s, key))
{
- /* Ok, can use the strategy */
- part1_conds_met= TRUE;
if (s->quick && s->quick->index == key &&
s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_RANGE)
{
@@ -205,6 +203,12 @@ public:
}
DBUG_PRINT("info", ("Can use LooseScan scan"));
+ if (found_part & 1)
+ {
+ /* Can use LooseScan on ref access if the first key part is bound */
+ part1_conds_met= TRUE;
+ }
+
/*
Check if this is a special case where there are no usable bound
IN-equalities, i.e. we have
@@ -212,11 +216,13 @@ public:
outer_expr IN (SELECT innertbl.key FROM ...)
and outer_expr cannot be evaluated yet, so it's actually full
- index scan and not a ref access
+ index scan and not a ref access.
+ We can do full index scan if it uses index-only.
*/
if (!(found_part & 1 ) && /* no usable ref access for 1st key part */
s->table->covering_keys.is_set(key))
{
+ part1_conds_met= TRUE;
DBUG_PRINT("info", ("Can use full index scan for LooseScan"));
/* Calculate the cost of complete loose index scan. */
@@ -384,6 +390,7 @@ public:
bool create_sj_weedout_tmp_table(THD *thd);
};
+int setup_semijoin_loosescan(JOIN *join);
int setup_semijoin_dups_elimination(JOIN *join, ulonglong options,
uint no_jbuf_after);
void destroy_sj_tmp_tables(JOIN *join);