title: How to reduce PostgreSQL database size?
body: <p>I was planning to move from MySQL to PostgreSQL because I wanted to make use of TimescaleDB.</p>
  
  <p>Everything looked good until I did a check on the storage size used by PostgreSQL (v11.2) compared to MySQL (v5.6). For exactly the same number of rows (1,440,000) and content:</p>
  
  <ul>
  <li>MySQL: 156 MB</li>
  <li>PostgreSQL: 246 MB</li>
  <li>PostgreSQL + TimescaleDB (partitioned/chunked data): 324 MB</li>
  </ul>
  
  <p>The MySQL and PostgreSQL numbers are like for like (i.e. including indexes and other constraints), the PostgreSQL + TimescaleDB has overhead of adding a timestamp to the table. The table concerned looks like this:</p>
  
  <pre><code>create table cell(
      cell_id            serial not null
     ,ts                 timestamp not null
     ,parent_id          int references parent( parent_id )
     ,instance_id        smallint
     ,v                  float
     ,a                  float
     ,t                  float
     ,s1                 float
     ,s2                 float
     ,s3                 float
     ,s4                 float
     ,s5                 float
     ,primary key( cell_id )
  );
  create index ix_cell_pid on cell( parent_id );
  create index ix_cell_inst on cell( instance_id );
  </code></pre>
  
  <p>Why does PostgreSQL occupy so much more storage than MySQL?<br>
  And is there some way of significantly reducing it near to the MySQL level?</p>