summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorVarun Gupta <varun.gupta@mariadb.com>2021-02-25 19:59:51 +0530
committerVarun Gupta <varun.gupta@mariadb.com>2021-03-04 22:50:00 +0530
commitf691d9865becfd242ba44cc632034433336af1e7 (patch)
tree8d30254398f114e7b61d3ecfbcb328e45ec3b946 /sql/handler.cc
parent71d30d01aa1426183526f9bdbc6d2a718fac75ac (diff)
downloadmariadb-git-f691d9865becfd242ba44cc632034433336af1e7.tar.gz
MDEV-7317: Make an index ignorable to the optimizer
This feature adds the functionality of ignorability for indexes. Indexes are not ignored be default. To control index ignorability explicitly for a new index, use IGNORE or NOT IGNORE as part of the index definition for CREATE TABLE, CREATE INDEX, or ALTER TABLE. Primary keys (explicit or implicit) cannot be made ignorable. The table INFORMATION_SCHEMA.STATISTICS get a new column named IGNORED that would store whether an index needs to be ignored or not.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 751a9cd0a97..8792c02194d 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -110,7 +110,7 @@ static handlerton *installed_htons[128];
#define BITMAP_STACKBUF_SIZE (128/8)
KEY_CREATE_INFO default_key_create_info=
-{ HA_KEY_ALG_UNDEF, 0, 0, {NullS, 0}, {NullS, 0}, true };
+{ HA_KEY_ALG_UNDEF, 0, 0, {NullS, 0}, {NullS, 0}, true, false };
/* number of entries in handlertons[] */
ulong total_ha= 0;
@@ -4885,7 +4885,8 @@ handler::check_if_supported_inplace_alter(TABLE *altered_table,
ALTER_PARTITIONED |
ALTER_VIRTUAL_GCOL_EXPR |
ALTER_RENAME |
- ALTER_RENAME_INDEX;
+ ALTER_RENAME_INDEX |
+ ALTER_INDEX_IGNORABILITY;
/* Is there at least one operation that requires copy algorithm? */
if (ha_alter_info->handler_flags & ~inplace_offline_operations)
@@ -4933,6 +4934,7 @@ Alter_inplace_info::Alter_inplace_info(HA_CREATE_INFO *create_info_arg,
index_drop_buffer(nullptr),
index_add_count(0),
index_add_buffer(nullptr),
+ index_altered_ignorability_count(0),
rename_keys(current_thd->mem_root),
handler_ctx(nullptr),
group_commit_ctx(nullptr),