1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

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.
This commit is contained in:
Varun Gupta
2021-02-25 19:59:51 +05:30
parent 71d30d01aa
commit f691d9865b
108 changed files with 2541 additions and 1422 deletions

View File

@@ -37,8 +37,8 @@ POINT(3 3)
POINT(3.1 3.1)
POINT(2 2)
show indexes from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 g 1 g A # 32 NULL SPATIAL
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 1 g 1 g A # 32 NULL SPATIAL NO
drop table t1;
create table t1 (name VARCHAR(100), square GEOMETRY not null, spatial index (square))engine=innodb;
INSERT INTO t1 VALUES("small", ST_GeomFromText('POLYGON (( 0 0, 0 1, 1 1, 1 0, 0 0))'));
@@ -183,10 +183,10 @@ POINT(3 3)
POINT(3.1 3.1)
POINT(2 2)
show indexes from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 i A # NULL NULL BTREE
t1 0 PRIMARY 2 i2 A # NULL NULL BTREE
t1 1 g 1 g A # 32 NULL SPATIAL
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Ignored
t1 0 PRIMARY 1 i A # NULL NULL BTREE NO
t1 0 PRIMARY 2 i2 A # NULL NULL BTREE NO
t1 1 g 1 g A # 32 NULL SPATIAL NO
drop table t1;
CREATE TABLE `t1` (
`id` int(11) NOT NULL AUTO_INCREMENT,