title: Why does the index occupy even more space than data in my MySQL table?
body: <p>I have a MySQL table with more than a billion rows hosted on Google Cloud SQL.</p>
  
  <pre><code>&gt;&gt; SHOW CREATE TABLE depth
  
  CREATE TABLE `depth` (
    `date` date DEFAULT NULL,
    `receive_time` datetime(3) DEFAULT NULL,
    `instrument_token` bigint(20) unsigned DEFAULT NULL,
    `level` tinyint(3) unsigned DEFAULT NULL,
    `bid_count` smallint(5) unsigned DEFAULT NULL,
    `bid_size` bigint(20) unsigned DEFAULT NULL,
    `bid_price` float DEFAULT NULL,
    `ask_price` float DEFAULT NULL,
    `ask_size` bigint(20) unsigned DEFAULT NULL,
    `ask_count` smallint(5) unsigned DEFAULT NULL,
     KEY `date_time_sym` (`date`,`receive_time`,`instrument_token`),
     KEY `date_sym_time` (`date`,`instrument_token`,`receive_time`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8
  </code></pre>
  
  <p>To get the data and index size, I run the query</p>
  
  <pre><code>SHOW TABLE STATUS from mktdata where Name = "depth";
  </code></pre>
  
  <p>Here I get a table output with one row, with value of a few important fields as:</p>
  
  <pre><code>Name: depth
  Engine:InnoDB
  Version:10
  Row_format:Dynamic
  Rows: 1,72,08,21,447 
  Avg_row_length: 78
  Index_length: 1,83,90,03,07,456
  Data_length:  1,35,24,53,32,480 
  </code></pre>
  
  <p>Question: Why is <code>Index_length</code> larger than <code>Data_length</code>? You can see my indexes above, why do they need so much space to be stored? I don't know much about how indexes are created and stored so please explain from the basics. </p>