Invisible Indexes - Oracle to Aurora MySQL Migration Playbook
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Invisible Indexes

Feature compatibility Amazon SCT / Amazon DMS automation level Amazon SCT action code index Key differences

No compatibility

No automation

Indexes

MySQL doesn’t support invisible indexes.

Oracle Usage

In Oracle, the invisible index feature gives database administrators the ability to create indexes, or change existing indexes, that are ignored by the optimizer. They are maintained during DML operations and are kept relevant, but are different from usable indexes.

The most common use cases for invisible indexes are:

  • Testing the effect of a dropped index without actually dropping it.

  • Using a specific index for certain operations or modules of an application without affecting the overall application.

  • Adding an index to a set of columns on which an index already exists.

Database administrators can force the optimizer to use invisible indexes by changing the OPTIMIZER_USE_INVISIBLE_INDEXES parameter to true. You can use invisible indexes if they are specified as a HINT.

Examples

Change an index to an invisible index.

ALTER INDEX idx_name INVISIBLE;

Change an invisible index to a visible index.

ALTER INDEX idx_name VISIBLE;

Create an invisible index.

CREATE INDEX idx_name ON employees(first_name) INVISIBLE;

Query all invisible indexes.

SELECT TABLE_OWNER, INDEX_NAME FROM DBA_INDEXES
  WHERE VISIBILITY = 'INVISIBLE';

For more information, see Understand When to Use Unusable or Invisible Indexes in the Oracle documentation.

MySQL Usage

Amazon Relational Database Service (Amazon RDS) for MySQL version 8 supports invisible indexes. An invisible index is not used by the optimizer at all but is otherwise maintained normally. Indexes are visible by default.

Invisible indexes make it possible to test the effect of removing an index on query performance without making a destructive change that must be undone should the index turn out to be required.

For more information, see Invisible Indexes in the MySQL documentation.