summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@mariadb.org>2022-08-20 08:22:57 +0300
committerSergei Petrunia <sergey@mariadb.com>2023-02-02 23:12:46 +0300
commit33fc8037e0a5c54c69732b3ee0eb7aea41392aed (patch)
tree34e4cab33afe331c86f7aef27d230eff6debc1ab /sql/sql_base.h
parent013ba37ae23040ca804c1ac2c293cab4ccb5731e (diff)
downloadmariadb-git-33fc8037e0a5c54c69732b3ee0eb7aea41392aed.tar.gz
Fixed some issues with FORCE INDEX
Added code to support that force index can be used to force an index scan instead of a full table scan. Currently this code is disable but I added a test to verify that things works if the code is ever enabled. Other things: - FORCE INDEX will now work with "Range checked for each record" and join cache (see main/type_time_6065) - Removed code ifdef with BAD_OPTIMIZATION (New cost calculations should fix this). - Removed TABLE_LIST->force_index and comment that it should be removed - Added TABLE->force_index_join and use in the corresponding places. This means that FORCE INDEX FOR ORDER BY will not affect keys used in joins anymore. Remove TODO that the above should be added. I still kept TABLE->force_index as it's used in test_if_cheaper_ordering() and opt_range.cc - Removed setting table->force_index when calling test_quick_select() as it's not needed (force_index is an argument to test_quick_select())
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r--sql/sql_base.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index c86a652c33a..1b294a468a9 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -357,7 +357,7 @@ inline void setup_table_map(TABLE *table, TABLE_LIST *table_list, uint tablenr)
}
table->tablenr= tablenr;
table->map= (table_map) 1 << tablenr;
- table->force_index= table_list->force_index;
+ table->force_index= table->force_index_join= 0;
table->force_index_order= table->force_index_group= 0;
table->covering_keys= table->s->keys_for_keyread;
}