title: Total size of database is bigger than sum of each table size in Postgresql
body: <p>Total DB size:</p>
  
  <pre><code>5620sam=# SELECT pg_size_pretty(pg_database_size('5620sam'));
   pg_size_pretty
  ----------------
   72 GB
  (1 row)
  </code></pre>
  
  <p>Files size on the disk:</p>
  
  <pre><code># du --apparent-size -h /var/lib/postgresql/9.5/main/
  &lt;...&gt;
  74G     /var/lib/postgresql/9.5/main/
  </code></pre>
  
  <p>But if I sum the size of each of the tables (with index) separately, I get 3 times less ~ 20 Gb:</p>
  
  <pre><code>5620sam=# SELECT
      table_name,
      pg_size_pretty(table_size) AS table_size,
      pg_size_pretty(indexes_size) AS indexes_size,
      pg_size_pretty(total_size) AS total_size
  FROM (
      SELECT
          table_name,
          pg_table_size(table_name) AS table_size,
          pg_indexes_size(table_name) AS indexes_size,
          pg_total_relation_size(table_name) AS total_size
      FROM (
          SELECT ('"' || table_schema || '"."' || table_name || '"') AS table_name
          FROM information_schema.tables
      ) AS all_tables
      ORDER BY total_size DESC
  ) AS pretty_sizes;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/6hZ9p.png" rel="nofollow noreferrer">Output - get ~ 20 Gb</a></p>
  
  <p>What happened to another 50 gigabytes? Where can I find them? VACUUM FULL does not help, do it every night.</p>