title: Database table size did not decrease proportionately
body: <p>I am working with a PostgreSQL 8.4.13 database.<br />
  Recently I had around around 86.5 million records in a table. I deleted almost all of them - only 5000 records are left. I ran</p>
  <pre><code>reindex
  </code></pre>
  <p>and</p>
  <pre><code>vacuum analyze
  </code></pre>
  <p>after deleting the rows. But I still see that the table is occupying a large disk space:</p>
  <pre><code>jbossql=&gt; SELECT pg_size_pretty(pg_total_relation_size('my_table'));
  pg_size_pretty 
  ----------------
  7673 MB
  </code></pre>
  <p>Also, the index value of the remaining rows are pretty high still - like in the million range. I thought after vacuuming and re-indexing, the index of the remaining rows would start from 1.</p>
  <p>I read the documentation and it's pretty clear that my understanding of re-indexing was skewed.</p>
  <p>But nonetheless, my intention is to reduce the table size after delete operation and bring down the index values so that the read operations (<code>SELECT</code>) from the table does not take that long - currently it's taking me around 40 seconds to retrieve just one record from my table.</p>
  <h3>Update</h3>
  <p>Thanks Erwin. I have corrected the pg version number.</p>
  <pre><code>vacuum full
  </code></pre>
  <p>worked for me. I have one follow up question here:<br />
  <a href="https://stackoverflow.com/questions/15526813/reatart-primary-key-numbers-of-existing-rows-after-deleting-most-of-a-big-table">Restart primary key numbers of existing rows after deleting most of a big table</a></p>