title: Why does dropping an index take longer than creating it?
body: <p>In postgresql, I added an index to a large table, and it took about 1 second (which, frankly, surprised me).</p>
  
  <p>When I went to drop the index, I let it run for >200 seconds without it returning, and finally cancelled the drop operation.</p>
  
  <pre><code>CREATE INDEX idx_cservicelocationdivisionstatus_inversed
  ON cservicelocationdivisionstatus (cservicelocationdivisionid, startdate, enddate DESC);
  </code></pre>
  
  <p>Takes very little time, but</p>
  
  <pre><code>DROP INDEX idx_cservicelocationdivisionstatus_inversed;
  </code></pre>
  
  <p>Took so long that I gave up and cancelled.</p>
  
  <p>The table <code>cservicelocationdivisionstatus</code> has 6 columns and about 310k rows of data.</p>
  
  <p>Why does removing an index take so much longer than creating it?</p>
  
  <p>EDIT: <a href="http://lists.mysql.com/mysql/202489" rel="noreferrer">This page</a> indicates that for mySql, a table with multiple indexes will copy the table and re-insert all the rows without the index you're dropping. (Worse, with mySql, if you drop multiple indexes on the same table, it will re-copy the table once for each index you're removing, instead of being smart and re-copying the data once without all the indexes you're dropping.) Is something like this happening with postgres?</p>