title: CouchDB Compaction and Doc Deletion - Compaction indifferent?
body: <p>Taking a simple CouchDB to a theory that CouchDB compaction is totally indifferent to deleted docs. </p>
  
  <p>Deleting a doc from couch via a DELETE method yields the following when trying to retrieve it:</p>
  
  <p>localhost:5984/enq/deleted-doc-id
  {"error":"not_found","reason":"deleted"}</p>
  
  <p>Expected.</p>
  
  <p>Now I compact the database:
  localhost:5984/enq/_compact
  {'ok': true }</p>
  
  <p>And check compaction has finished
  "compact_running":false </p>
  
  <p>Now I would expect CouchDB to return not_found, reason "missing" on a simple GET
  localhost:5984/enq/deleted-doc-id
  {"error":"not_found","reason":"deleted"}</p>
  
  <p>And trying with ?rev=deleted_rev gives me a ful doc, yeah for worthless data.</p>
  
  <p>So am I correct in thinking the couchdb compaction shows no special treatment for deleted docs and simple looks at the rev count again rev limit when deciding what is part of compaction. Is there a special rev_limit we can set for deleted docs?</p>
  
  <p>Surely the only solution can't be a _purge? at the moment we must have thousands of orphaned deleted docs, and whilst we want to maintain some version history for normal docs we dont want to reduce our rev_limit to 1 to assist in this scenario</p>
  
  <p>What are the replication issues we should be aware of with purge?</p>