Pre-General Availability Draft: 2017-07-22
With the introduction of the data dictionary, the following
INFORMATION_SCHEMA tables are
implemented as views on data dictionary tables:
Queries on those tables are now more efficient because they obtain
information from data dictionary tables rather than by other,
slower means. In particular, for each
INFORMATION_SCHEMA table that is a view on data
The server no longer must create a temporary table for each query of the
When the underlying data dictionary tables store values previously obtained by directory scans (for example, to enumerate database names or table names within databases) or file-opening operations (for example, to read information from
INFORMATION_SCHEMAqueries for those values now use table lookups instead. (Additionally, even for a non-view
INFORMATION_SCHEMAtable, values such as database and table names are retrieved by lookups from the data dictionary and do not require directory or file scans.)
Indexes on the underlying data dictionary tables permit the optimizer to construct efficient query execution plans, something not true for the previous implementation that processed the
INFORMATION_SCHEMAtable using a temporary table per query.
The preceding improvements also apply to
SHOW statements that display
information corresponding to the
INFORMATION_SCHEMA tables that are views on
data dictionary tables. For example,
DATABASES displays the same information as the
In addition to the introduction of views on data dictionary
tables, table metadata contained in the
TABLES tables is now cached to
performance. Caching of table metadata is controlled by the
configuration option, which is set to
default. Cached table metadata is updated by issuing an
ANALYZE TABLE statement.
information_schema_stats can be
LATEST to have
INFORMATION_SCHEMA queries retrieve
the latest metadata directly from the storage engine, which is not
as fast as retrieving cached table metadata.
For more information, see Section 8.2.3, “Optimizing INFORMATION_SCHEMA Queries”.