## 14.5 INFORMATION\_SCHEMA and Data Dictionary Integration

[]()

 With the introduction of the data dictionary, the following [`INFORMATION_SCHEMA`](information-schema.html) tables are implemented as views on data dictionary tables:

* [`CHARACTER_SETS`](information-schema-character-sets-table.html)

* [`CHECK_CONSTRAINTS`](information-schema-check-constraints-table.html)

* [`COLLATIONS`](information-schema-collations-table.html)

* [`COLLATION_CHARACTER_SET_APPLICABILITY`](information-schema-collation-character-set-applicability-table.html)

* [`COLUMNS`](information-schema-columns-table.html)

* [`COLUMN_STATISTICS`](information-schema-column-statistics-table.html)

* [`EVENTS`](information-schema-events-table.html)

* [`FILES`](information-schema-files-table.html)

* [`INNODB_COLUMNS`](information-schema-innodb-columns-table.html)

* [`INNODB_DATAFILES`](information-schema-innodb-datafiles-table.html)

* [`INNODB_FIELDS`](information-schema-innodb-fields-table.html)

* [`INNODB_FOREIGN`](information-schema-innodb-foreign-table.html)

* [`INNODB_FOREIGN_COLS`](information-schema-innodb-foreign-cols-table.html)

* [`INNODB_INDEXES`](information-schema-innodb-indexes-table.html)

* [`INNODB_TABLES`](information-schema-innodb-tables-table.html)

* [`INNODB_TABLESPACES`](information-schema-innodb-tablespaces-table.html)

* [`INNODB_TABLESPACES_BRIEF`](information-schema-innodb-tablespaces-brief-table.html)

* [`INNODB_TABLESTATS`](information-schema-innodb-tablestats-table.html)

* [`KEY_COLUMN_USAGE`](information-schema-key-column-usage-table.html)

* `KEYWORDS`

* [`PARAMETERS`](information-schema-parameters-table.html)

* [`PARTITIONS`](information-schema-partitions-table.html)

* [`REFERENTIAL_CONSTRAINTS`](information-schema-referential-constraints-table.html)

* [`RESOURCE_GROUPS`](information-schema-resource-groups-table.html)

* [`ROUTINES`](information-schema-routines-table.html)

* [`SCHEMATA`](information-schema-schemata-table.html)

* [`STATISTICS`](information-schema-statistics-table.html)

* [`ST_GEOMETRY_COLUMNS`](information-schema-st-geometry-columns-table.html)

* [`ST_SPATIAL_REFERENCE_SYSTEMS`](information-schema-st-spatial-reference-systems-table.html)

* [`TABLES`](information-schema-tables-table.html)

* [`TABLE_CONSTRAINTS`](information-schema-table-constraints-table.html)

* [`TRIGGERS`](information-schema-triggers-table.html)

* [`VIEWS`](information-schema-views-table.html)

* [`VIEW_ROUTINE_USAGE`](information-schema-view-routine-usage-table.html)

* [`VIEW_TABLE_USAGE`](information-schema-view-table-usage-table.html)

 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 dictionary tables:

* The server no longer must create a temporary table for each query of the `INFORMATION_SCHEMA` table.

* 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 `.frm` files), `INFORMATION_SCHEMA` queries for those values now use table lookups instead. (Additionally, even for a non-view `INFORMATION_SCHEMA` table, 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_SCHEMA` table using a temporary table per query.

 The preceding improvements also apply to [`SHOW`](show.html) statements that display information corresponding to the `INFORMATION_SCHEMA` tables that are views on data dictionary tables. For example, [`SHOW DATABASES`](show-databases.html) displays the same information as the [`SCHEMATA`](information-schema-schemata-table.html) table.

 In addition to the introduction of views on data dictionary tables, table statistics contained in the [`STATISTICS`](information-schema-statistics-table.html) and [`TABLES`](information-schema-tables-table.html) tables is now cached to improve [`INFORMATION_SCHEMA`](information-schema.html) query performance. The [`information_schema_stats_expiry`](server-system-variables.html#sysvar_information_schema_stats_expiry) system variable defines the period of time before cached table statistics expire. The default is 86400 seconds (24 hours). If there are no cached statistics or statistics have expired, statistics are retrieved from storage engine when querying table statistics columns. To update cached values at any time for a given table, use [`ANALYZE TABLE`](analyze-table.html)

[`information_schema_stats_expiry`](server-system-variables.html#sysvar_information_schema_stats_expiry) can be set to `0` to have [`INFORMATION_SCHEMA`](information-schema.html) queries retrieve the latest statistics directly from the storage engine, which is not as fast as retrieving cached statistics.

 For more information, see [Section 8.2.3, “Optimizing INFORMATION\_SCHEMA Queries”](information-schema-optimization.html).

`INFORMATION_SCHEMA` tables in MySQL 8.0 are closely tied to the data dictionary, resulting in several usage differences. See [Section 14.7, “Data Dictionary Usage Differences”](data-dictionary-usage-differences.html).

