title: MySql primary key doesn't consume any size
body: <p>I have those two tables schema:</p>
  
  <pre><code>CREATE TABLE `myTable` (
    id int(11) NOT NULL AUTO_INCREMENT,
    lat double NOT NULL,
    lng double NOT NULL,
    date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mobile bigint(11) unsigned NOT NULL,
    date_updated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  
    PRIMARY KEY (`id`),
    KEY `IDX_Datee` (`mobile`,`date`),
    CONSTRAINT `FK_DeviceLocationss` FOREIGN KEY (`mobile`) REFERENCES `device` (`serial`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>And here is the second one:</p>
  
  <pre><code>CREATE TABLE `myTable2` (
    lat double NOT NULL,
    lng double NOT NULL,
    date datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
    mobile bigint(11) unsigned NOT NULL,
    date_updated datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  
    PRIMARY KEY `IDX_Datee2` (`mobile`,`date`),
    CONSTRAINT `FK_DeviceLocationss2` FOREIGN KEY (`mobile`) REFERENCES `device` (`serial`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>In every table there are around <strong>4,000,000</strong> records till now,
  So I'm trying to build the most suitable schema which is more fast and less storage consuming.</p>
  
  <p>When I check the state of each <code>Table</code> in <code>MySql Workbeanch</code> I got little confusing:</p>
  
  <p><strong>First Table:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/fsdNV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fsdNV.png" alt="enter image description here"></a></p>
  
  <p><strong>Second Table</strong></p>
  
  <p><a href="https://i.stack.imgur.com/HjMg7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HjMg7.png" alt="enter image description here"></a></p>
  
  <p>When I changed the <code>IDX_Datee</code> key from <code>Index</code> to <code>Primary</code>, It doesn't consume any space.</p>
  
  <p>I believe the second schema is better for me, But I don't have a good understand about that difference.</p>
  
  <p>Can anyone explain that?</p>