MySQL Finding index size for compound unique indexes

indexindex-tuningMySQLunique-constraint

I'm using following query to get index and data sizes for tables in database. But unfortunately it doesn't show index size for compound unique indexes. How can i get index sizes for compound unique indexes?

Here is my query;

SELECT TABLE_NAME AS "Table",
TABLE_ROWS AS "Rows",
CONCAT((FORMAT((DATA_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Data Size",
CONCAT((FORMAT((INDEX_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Index Size",
CONCAT((FORMAT((DATA_LENGTH+ INDEX_LENGTH) / POWER(1024,2),2)), ' Mb') AS "Total Size",
TRIM(TRAILING ', ' FROM CONCAT_WS(', ', ENGINE, TABLE_COLLATION, CREATE_OPTIONS)) AS "Type"
FROM information_schema.TABLES
WHERE information_schema.TABLES.table_schema = "my_database_name_here"

Best Answer

For MySQL (not Percona), see if this table gives you what you want:

mysql.INNODB_INDEX_STATS

Sorry, but it is not easy to tease out the specific data you asked about.