0

I checked information about my mysql database, and found, that index_length on tables, that have index only on primary_key column is 0. Index_length of other tables, that have foreign keys and indexes on them has value. Why is it so?

enter image description here

UPDATE: Thanks for help, also nice answer given here: How to find out size of indexes in mysql (including primary keys)

Community
  • 1
  • 1
vsezan MDA
  • 131
  • 1
  • 5
  • 1
    each table has only one primary key (or no primary key) ; the data in the table is physically sorted by the primary key, so it takes 0 extra storage.. – houssam May 19 '15 at 06:50

1 Answers1

2

The table type is InnoDB. InnoDB stores the data in the primary key (index-organized table). So the primary key is already accounted in the DATA_LENGTH. INDEX_LENGTH means "the size of all secondary indexes".

Vojtech Kurka
  • 875
  • 9
  • 10