title: Why is my table size more than 4x larger than expected? (rows*bytes/row)
body: <p>I'm looking at a simple table in MySQL that has 4 columns with the following sizes,</p>
  
  <pre><code>unsigned bigint (8 bytes)
  unsigned bigint (8 bytes)
  unsigned smallint (2 bytes)
  unsigned tinyint (1 byte)
  </code></pre>
  
  <p>So I would expect 19 bytes/row.</p>
  
  <p>There are 1,654,150 rows in this table so the size of the data should be 31,428,850 bytes (or about 30 megabytes).</p>
  
  <p>But I can see via phpMyAdmin that the data is taking up 136.3 MiB (not including the size of the Index on <code>bigint 1, smallint, tinyint</code> which is 79 MiB).</p>
  
  <p>Storage Engine is InnoDB and Primary Key is <code>bigint 1, bigint 2</code> (a user ID and a unique item id).</p>
  
  <hr>
  
  <p><strong>Edit:</strong> As requested in the comments, here is the result of a <code>SHOW CREATE TABLE storage</code></p>
  
  <pre><code>CREATE TABLE `storage` (
   `fbid` bigint(20) unsigned NOT NULL,
   `unique_id` bigint(20) unsigned NOT NULL,
   `collection_id` smallint(5) unsigned NOT NULL,
   `egg_id` tinyint(3) unsigned NOT NULL,
   PRIMARY KEY (`fbid`,`unique_id`),
   KEY `fbid` (`fbid`,`collection_id`,`egg_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8
  </code></pre>