Syntax\n------\n\nSHOW {INDEX | INDEXES | KEYS} \n FROM tbl_name [FROM db_name]\n [WHERE expr]\n\nDescription\n-----------\n\nSHOW INDEX returns table index information. The format resembles that of the SQLStatistics call in ODBC.\n\nYou can use db_name.tbl_name as an alternative to thetbl_name FROM db_name syntax. These two statements are equivalent:\n\n``sql\nSHOW INDEX FROM mytable FROM mydb;\nSHOW INDEX FROM mydb.mytable;\n`\n\nSHOW KEYS and SHOW INDEXES are synonyms for SHOW INDEX.\n\nYou can also list a table's indexes with the mariadb-show command:\n\n`sql\nmariadb-show -k db_name tbl_name\n`\n\nThe information_schema.STATISTICS table stores similar information.\n\nThe following fields are returned by SHOW INDEX.\n\n| Field          | Description                                                                                                                                                                                                                                                                              |\n| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Table          | Table name                                                                                                                                                                                                                                                                               |\n| Non_unique    | 1 if the index permits duplicate values, 0 if values must be unique.                                                                                                                                                                                                                     |\n| Key_name      | Index name. The primary key is always named PRIMARY.                                                                                                                                                                                                                                     |\n| Seq_in_index | The column's sequence in the index, beginning with 1.                                                                                                                                                                                                                                    |\n| Column_name   | Column name.                                                                                                                                                                                                                                                                             |\n| Collation      | Either A, if the column is sorted in ascending order in the index, or NULL if it's not sorted.                                                                                                                                                                                           |\n| Cardinality    | Estimated number of unique values in the index. The cardinality statistics are calculated at various times, and can help the optimizer make improved decisions.                                                                                                                          |\n| Sub_part      | NULL if the entire column is included in the index, or the number of included characters if not.                                                                                                                                                                                         |\n| Packed         | NULL if the index is not packed, otherwise how the index is packed.                                                                                                                                                                                                                      |\n| Null           | NULL if NULL values are permitted in the column, an empty string if NULLs are not permitted.                                                                                                                                                                                             |\n| Index_type    | The index type, which can be BTREE, FULLTEXT, HASH or RTREE. See Storage Engine Index Types.                                                                            |\n| Comment        | Other information, such as whether the index is disabled.                                                                                                                                                                                                                                |\n| Index_comment | Contents of the COMMENT attribute when the index was created.                                                                                                                                                                                                                            |\n| Ignored        | Whether or not an index will be ignored by the optimizer. See Ignored Indexes. From MariaDB 10.6.0. |\n\nThe WHERE and LIKE clauses can be given to select rows using more general conditions, as discussed in Extended SHOW.\n\nExamples\n--------\n\nCREATE TABLE IF NOT EXISTS employees_example (\n  id INT(11) NOT NULL AUTO_INCREMENT,\n  first_name VARCHAR(30) NOT NULL,\n  last_name VARCHAR(40) NOT NULL,\n  position VARCHAR(25) NOT NULL,\n  home_address VARCHAR(50) NOT NULL,\n  home_phone VARCHAR(12) NOT NULL,\n  employee_code VARCHAR(25) NOT NULL,\n  PRIMARY KEY (id),\n  UNIQUE KEY employee_code (employee_code),\n  KEY first_name (first_name,last_name)\n) ENGINE=Aria;\n\nINSERT INTO employees_example (first_name, last_name, position, home_address, home_phone, employee_code`)\n  VALUES\n  ('Mustapha', 'Mond', 'Chief Executive Officer', '692 Promiscuous Plaza', '326-555-3492', 'MM1'),\n  ('Henry', 'Foster', 'Store Manager', '314 Savage Circle', '326-555-3847', 'HF1'),\n  ('Bernard', 'Marx', 'Cashier', '1240 Ambient Avenue', '326-555-8456', 'BM1'),\n  ('Lenina', 'Crowne', 'Cashier', '281 Bumblepuppy Boulevard', '328-555-2349', 'LC1'),\n  ('Fanny', 'Crowne', 'Restocker', '1023 Bokanovsky Lane', '326-555-6329', 'FC1'),\n  ('Helmholtz', 'Watson', 'Janitor', '944 Soma Court', '329-555-2478', 'HW1');\n\nURL: https://mariadb.com/docs/server/reference/sql-statements/administrative-sql-statements/show/show-index