Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
SYNTAX
An index can be ignored in the following way:
1) Adding IGNORED to the key specification in CREATE TABLE
Example
CREATE TABLE t1(a INT, key key1(a) IGNORE); |
2) Adding IGNORED to the key specification in CREATE INDEX
Example
CREATE INDEX key1 on t1 (a) IGNORE; |
3) Adding IGNORED to the key in the ALTER statement
New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability
ignorability:
IGNORE_SYM |
NOT IGNORE_SYM |
Example:
ALTER TABLE t1 ADD INDEX key1 IGNORE; |
Specifications
- Store the information about the ignorability of the index in the FRM.
- A primary index cannot be made IGNORABLE.
- A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE.
- CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not.
- An ALTER INDEX operation should use the INPLACE algorithm by default.
Attachments
Issue Links
- causes
-
MDEV-25075 Ignorable index makes the resulting CREATE TABLE invalid
-
- Closed
-
- includes
-
MDEV-22199 Add VISIBLE attribute for indexes in CREATE TABLE
-
- Closed
-
- relates to
-
MDEV-33777 Spider: ERROR 12710 (HY000): Invalid information from remote table when using MariaDB 10.5 local and MariaDB 10.6 remote
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
Oracle 11g added invisible indexes, which would also be useful in MariaDB. Morgan Tocker filed a MySQL bug to add that feature: http://bugs.mysql.com/bug.php?id=70299 http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5011.htm "VISIBLE | INVISIBLE Use this clause to specify whether the index is visible or invisible to the optimizer. An invisible index is maintained by DML operations, but it is not be used by the optimizer during queries unless you explicitly set the parameter OPTIMIZER_USE_INVISIBLE_INDEXES to TRUE at the session or system level. To determine whether an existing index is visible or invisible to the optimizer, you can query the VISIBILITY column of the USER_, DBA_, ALL_INDEXES data dictionary views." http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#ADMIN12317 http://www.dba-oracle.com/t_11g_new_index_features.htm Note that MariaDB does have an older, more general mechanism already for making invisible indexes: ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; Suggested new syntax in MariaDB: CREATE TABLE t1 (id int(10), name char(20), KEY idx_name(name) INVISIBLE); ALTER TABLE t1 CHANGE INDEX idx_name INVISIBLE; ALTER TABLE t1 CHANGE INDEX idx_name VISIBLE; CREATE INDEX ... index_option: KEY_BLOCK_SIZE [=] value | index_type | WITH PARSER parser_name | INVISIBLE | VISIBLE | COMMENT 'string' Some of the server areas this code will affect: - parser (create table, create index, alter table) - optimizer |
Oracle 11g added invisible indexes, which would also be useful in MariaDB. Morgan Tocker filed a MySQL bug to add that feature: http://bugs.mysql.com/bug.php?id=70299 http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5011.htm "VISIBLE | INVISIBLE Use this clause to specify whether the index is visible or invisible to the optimizer. An invisible index is maintained by DML operations, but it is not be used by the optimizer during queries unless you explicitly set the parameter OPTIMIZER_USE_INVISIBLE_INDEXES to TRUE at the session or system level. To determine whether an existing index is visible or invisible to the optimizer, you can query the VISIBILITY column of the USER_, DBA_, ALL_INDEXES data dictionary views." http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#ADMIN12317 http://www.dba-oracle.com/t_11g_new_index_features.htm Note that MariaDB does have an older, more general mechanism already for making invisible indexes: ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; Suggested new syntax in MariaDB: CREATE TABLE t1 (id int(10), name char(20), KEY idx_name(name) INVISIBLE); ALTER TABLE t1 CHANGE INDEX idx_name INVISIBLE; ALTER TABLE t1 CHANGE INDEX idx_name VISIBLE; CREATE INDEX ... index_option: KEY_BLOCK_SIZE [=] value / index_type / WITH PARSER parser_name / INVISIBLE | VISIBLE / COMMENT 'string' Some of the server areas this code will affect: - parser (create table, create index, alter table) - optimizer |
Description |
Oracle 11g added invisible indexes, which would also be useful in MariaDB. Morgan Tocker filed a MySQL bug to add that feature: http://bugs.mysql.com/bug.php?id=70299 http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5011.htm "VISIBLE | INVISIBLE Use this clause to specify whether the index is visible or invisible to the optimizer. An invisible index is maintained by DML operations, but it is not be used by the optimizer during queries unless you explicitly set the parameter OPTIMIZER_USE_INVISIBLE_INDEXES to TRUE at the session or system level. To determine whether an existing index is visible or invisible to the optimizer, you can query the VISIBILITY column of the USER_, DBA_, ALL_INDEXES data dictionary views." http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#ADMIN12317 http://www.dba-oracle.com/t_11g_new_index_features.htm Note that MariaDB does have an older, more general mechanism already for making invisible indexes: ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; Suggested new syntax in MariaDB: CREATE TABLE t1 (id int(10), name char(20), KEY idx_name(name) INVISIBLE); ALTER TABLE t1 CHANGE INDEX idx_name INVISIBLE; ALTER TABLE t1 CHANGE INDEX idx_name VISIBLE; CREATE INDEX ... index_option: KEY_BLOCK_SIZE [=] value / index_type / WITH PARSER parser_name / INVISIBLE | VISIBLE / COMMENT 'string' Some of the server areas this code will affect: - parser (create table, create index, alter table) - optimizer |
Oracle 11g added invisible indexes, which would also be useful in MariaDB. Morgan Tocker filed a MySQL bug to add that feature: http://bugs.mysql.com/bug.php?id=70299 http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5011.htm "VISIBLE | INVISIBLE Use this clause to specify whether the index is visible or invisible to the optimizer. An invisible index is maintained by DML operations, but it is not be used by the optimizer during queries unless you explicitly set the parameter OPTIMIZER_USE_INVISIBLE_INDEXES to TRUE at the session or system level. To determine whether an existing index is visible or invisible to the optimizer, you can query the VISIBILITY column of the USER_, DBA_, ALL_INDEXES data dictionary views." http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#ADMIN12317 http://www.dba-oracle.com/t_11g_new_index_features.htm Note that MariaDB does have an older, more general mechanism already for making invisible indexes: {code:sql} ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; {code} Suggested new syntax in MariaDB: {noformat} CREATE TABLE t1 (id int(10), name char(20), KEY idx_name(name) INVISIBLE); ALTER TABLE t1 CHANGE INDEX idx_name INVISIBLE; ALTER TABLE t1 CHANGE INDEX idx_name VISIBLE; CREATE INDEX ... index_option: KEY_BLOCK_SIZE [=] value / index_type / WITH PARSER parser_name / INVISIBLE | VISIBLE / COMMENT 'string' {noformat} Some of the server areas this code will affect: - parser (create table, create index, alter table) - optimizer |
Workflow | MariaDB v2 [ 58951 ] | MariaDB v3 [ 62488 ] |
Summary | Feature request: make an index invisible to the optimizer | Make an index invisible to the optimizer |
Link |
This issue includes |
Assignee | Varun Gupta [ varun ] |
Fix Version/s | 10.6 [ 24028 ] |
Priority | Minor [ 4 ] | Major [ 3 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Description |
Oracle 11g added invisible indexes, which would also be useful in MariaDB. Morgan Tocker filed a MySQL bug to add that feature: http://bugs.mysql.com/bug.php?id=70299 http://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_5011.htm "VISIBLE | INVISIBLE Use this clause to specify whether the index is visible or invisible to the optimizer. An invisible index is maintained by DML operations, but it is not be used by the optimizer during queries unless you explicitly set the parameter OPTIMIZER_USE_INVISIBLE_INDEXES to TRUE at the session or system level. To determine whether an existing index is visible or invisible to the optimizer, you can query the VISIBILITY column of the USER_, DBA_, ALL_INDEXES data dictionary views." http://docs.oracle.com/cd/B28359_01/server.111/b28310/indexes003.htm#ADMIN12317 http://www.dba-oracle.com/t_11g_new_index_features.htm Note that MariaDB does have an older, more general mechanism already for making invisible indexes: {code:sql} ALTER TABLE t1 DISABLE KEYS; ALTER TABLE t1 ENABLE KEYS; {code} Suggested new syntax in MariaDB: {noformat} CREATE TABLE t1 (id int(10), name char(20), KEY idx_name(name) INVISIBLE); ALTER TABLE t1 CHANGE INDEX idx_name INVISIBLE; ALTER TABLE t1 CHANGE INDEX idx_name VISIBLE; CREATE INDEX ... index_option: KEY_BLOCK_SIZE [=] value / index_type / WITH PARSER parser_name / INVISIBLE | VISIBLE / COMMENT 'string' {noformat} Some of the server areas this code will affect: - parser (create table, create index, alter table) - optimizer |
SYNTAX An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example CREATE TABLE t1(a INT, key key1(a) IGNORE) 2) Adding IGNORED to the key specification in CREATE INDEX Example CREATE INDEX key1 on t1 (a) IGNORE 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example; ALTER TABLE t1 ADD INDEX key1 IGNORE; Specifications a) Store the information about the ignorability of the index in the FRM b) A primary index cannot be made IGNORABLE c) A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE d) CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not e) Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes : on/off [name for the switch can be reconisdered] f) An ALTER INDEX operation should use the INPLACE algorithm by default. |
Summary | Make an index invisible to the optimizer | Make an index ignorable to the optimizer |
Description |
SYNTAX An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example CREATE TABLE t1(a INT, key key1(a) IGNORE) 2) Adding IGNORED to the key specification in CREATE INDEX Example CREATE INDEX key1 on t1 (a) IGNORE 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example; ALTER TABLE t1 ADD INDEX key1 IGNORE; Specifications a) Store the information about the ignorability of the index in the FRM b) A primary index cannot be made IGNORABLE c) A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE d) CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not e) Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes : on/off [name for the switch can be reconisdered] f) An ALTER INDEX operation should use the INPLACE algorithm by default. |
SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example CREATE TABLE t1(a INT, key key1(a) IGNORE) 2) Adding IGNORED to the key specification in CREATE INDEX Example CREATE INDEX key1 on t1 (a) IGNORE 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example; ALTER TABLE t1 ADD INDEX key1 IGNORE; Specifications a) Store the information about the ignorability of the index in the FRM b) A primary index cannot be made IGNORABLE c) A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE d) CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not e) Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes : on/off [name for the switch can be reconisdered] f) An ALTER INDEX operation should use the INPLACE algorithm by default. |
Description |
SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example CREATE TABLE t1(a INT, key key1(a) IGNORE) 2) Adding IGNORED to the key specification in CREATE INDEX Example CREATE INDEX key1 on t1 (a) IGNORE 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example; ALTER TABLE t1 ADD INDEX key1 IGNORE; Specifications a) Store the information about the ignorability of the index in the FRM b) A primary index cannot be made IGNORABLE c) A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE d) CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not e) Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes : on/off [name for the switch can be reconisdered] f) An ALTER INDEX operation should use the INPLACE algorithm by default. |
SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example CREATE TABLE t1(a INT, key key1(a) IGNORE) 2) Adding IGNORED to the key specification in CREATE INDEX Example CREATE INDEX key1 on t1 (a) IGNORE 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example; ALTER TABLE t1 ADD INDEX key1 IGNORE; Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
Description |
SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example CREATE TABLE t1(a INT, key key1(a) IGNORE) 2) Adding IGNORED to the key specification in CREATE INDEX Example CREATE INDEX key1 on t1 (a) IGNORE 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example; ALTER TABLE t1 ADD INDEX key1 IGNORE; Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
h3. SYNTAX
h3. An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE) {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
Description |
h3. SYNTAX
h3. An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE) {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
h3. SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE); {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE; {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
Description |
h3. SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE); {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE; {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
h3. SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE); {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE; {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
Assignee | Varun Gupta [ varun ] | Sergei Petrunia [ psergey ] |
Status | In Progress [ 3 ] | In Review [ 10002 ] |
Assignee | Sergei Petrunia [ psergey ] | Sergei Golubchik [ serg ] |
Rank | Ranked higher |
Priority | Major [ 3 ] | Critical [ 2 ] |
Assignee | Sergei Golubchik [ serg ] | Sergei Petrunia [ psergey ] |
Assignee | Sergei Petrunia [ psergey ] | Varun Gupta [ varun ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Component/s | Data Definition - Alter Table [ 10114 ] | |
Component/s | Data Definition - Create Table [ 14503 ] | |
Component/s | Optimizer [ 10200 ] | |
Fix Version/s | 10.6.0 [ 24431 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Link |
This issue causes |
Link | This issue causes TODO-2814 [ TODO-2814 ] |
Link | This issue causes TODO-2815 [ TODO-2815 ] |
Description |
h3. SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE); {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE; {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * Introduce an optimizer switch that would allow the optimizer to not consider the ignorable indexes ignore_indexes: on/off [name for the switch can be reconisdered] * An ALTER INDEX operation should use the INPLACE algorithm by default. |
h3. SYNTAX
An index can be ignored in the following way: 1) Adding IGNORED to the key specification in CREATE TABLE Example {code:sql} CREATE TABLE t1(a INT, key key1(a) IGNORE); {code} 2) Adding IGNORED to the key specification in CREATE INDEX Example {code:sql} CREATE INDEX key1 on t1 (a) IGNORE; {code} 3) Adding IGNORED to the key in the ALTER statement New syntax: ALTER TABLE table_name ALTER INDEX key_name ignorability ignorability: | IGNORE_SYM | NOT IGNORE_SYM Example: {code:sql} ALTER TABLE t1 ADD INDEX key1 IGNORE; {code} h3. Specifications * Store the information about the ignorability of the index in the FRM. * A primary index cannot be made IGNORABLE. * A non-nullable unique key that is promoted to a primary key cannot be made IGNORABLE. * CHANGES in the output of SHOW CREATE TABLE and SHOW INDEXES|KEYS to show if the index is IGNORED or not. * An ALTER INDEX operation should use the INPLACE algorithm by default. |
Workflow | MariaDB v3 [ 62488 ] | MariaDB v4 [ 132487 ] |
Link |
This issue relates to |
Here's the syntax I've implemented in the parser:
\W
show warnings;
mysql> \W
Show warnings enabled.
mysql> drop table if exists t1;
Query OK, 0 rows affected, 2 warnings (0.00 sec)
Note (Code 1051): Unknown table 'test.t1'
mysql> create table t1 (id int, col1 char(3), key idx_id (id) visible) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Query OK, 0 rows affected (0.20 sec)
mysql> create index idx_col1 on t1 (col1) visible;
Query OK, 0 rows affected (0.07 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> show create table t1;
| Table | Create Table |
| t1 | CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL,
`col1` char(3) DEFAULT NULL,
KEY `idx_id` (`id`),
KEY `idx_col1` (`col1`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
1 row in set (0.00 sec)
mysql> insert into t1 (id, col1) values (1,'abc'), (2, 'def');
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> alter table t1 change index idx_col1 invisible;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table t1 change index idx_col1 visible;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> alter table t1 change index idx_id invisible, change index idx_col1 invisible;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> select id, col1 from t1 order by id;
+------+------+
| id | col1 |
+------+------+
| 1 | abc |
| 2 | def |
+------+------+
2 rows in set (0.00 sec)
mysql> drop table if exists t1;
Query OK, 0 rows affected, 1 warning (0.03 sec)