percona_server_views

SYNOPSIS

Percona server views: views enhancing INFORMATION_SCHEMA tables available in Percona Server.

DESCRIPTION

These views rely on the INNODB_INDEX_STATS feature to be enabled. The views are compatible with recent versions of Percona Server (due to changes to INNODB_INDEX_STATS schema in Percona Server 5.5.8, these views are incompatible with earlier versions).

EXAMPLES

Examine keys selectivity/cardinality on a specific table:

mysql> SELECT * FROM common_schema.innodb_index_rows WHERE TABLE_SCHEMA='sakila' AND TABLE_NAME='inventory';
+--------------+------------+----------------------+--------------+--------------+-------------------------+-------------------------+
| TABLE_SCHEMA | TABLE_NAME | INDEX_NAME           | SEQ_IN_INDEX | COLUMN_NAME  | is_last_column_in_index | incremental_row_per_key |
+--------------+------------+----------------------+--------------+--------------+-------------------------+-------------------------+
| sakila       | inventory  | PRIMARY              |            1 | inventory_id |                       1 |                       1 |
| sakila       | inventory  | idx_fk_film_id       |            1 | film_id      |                       1 |                       5 |
| sakila       | inventory  | idx_store_id_film_id |            1 | store_id     |                       0 |                    4478 |
| sakila       | inventory  | idx_store_id_film_id |            2 | film_id      |                       1 |                       2 |
+--------------+------------+----------------------+--------------+--------------+-------------------------+-------------------------+

 
common_schema documentation