Oracle 11g added invisible indexes, which would also be useful in MariaDB.
Morgan Tocker filed a MySQL bug to add that feature:
"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."
Note that MariaDB does have an older, more general mechanism already for making invisible indexes:
Suggested new syntax in MariaDB:
Some of the server areas this code will affect:
- parser (create table, create index, alter table)