incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Kocoloski <>
Subject Re: Discard old version while update document
Date Sat, 28 Mar 2009 18:36:22 GMT
On Mar 28, 2009, at 2:44 PM, Niket Patel wrote:

>> Good point, Jeff.  Revision stemming helps keep the size of the
>> frequently-updated document under control and slows the growth of the
>> database file.  However, if you want to reclaim the disk space used  
>> by
>> the old revisions, you still need to compact the whole DB.  Cheers,
> Thanks Jeff and Adam,
> That is enough for our needs, Since tests are not clear about effect  
> of stemming on file size.
> If I keep _revs_limit to 10 , will that keep db file size nearly  
> same if I only keep updating single document using nearly same size  
> document for each revision?

Hi, revision pruning only slows the growth of the DB; the DB will  
still get larger with every update.  Assuming no compaction or  
pruning, the disk space needed to store document revision metadata  
grows quadratically with the number of revisions.  When you truncate  
the number of revisions you keep the growth rate reduces to a linear  

Whether that reduction from quadratic to linear metadata growth is a  
big win for you depends on the frequency of updates and the size of  
the document.  If the frequently-updated documents are really large  
the DB file size growth will be dominated by document data rather than  
the revision metadata.  Hope it helps,


View raw message