Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 42675 invoked from network); 20 Feb 2009 16:24:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2009 16:24:05 -0000 Received: (qmail 53533 invoked by uid 500); 20 Feb 2009 16:24:01 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 53502 invoked by uid 500); 20 Feb 2009 16:24:01 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 53491 invoked by uid 99); 20 Feb 2009 16:24:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 08:24:01 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of robert.newson@gmail.com designates 209.85.162.180 as permitted sender) Received: from [209.85.162.180] (HELO el-out-1112.google.com) (209.85.162.180) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 16:23:53 +0000 Received: by el-out-1112.google.com with SMTP id s27so472848ele.14 for ; Fri, 20 Feb 2009 08:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=4v4pRKldB8N+Iv0+lMddlo5+bBC0/4BPL0CVQoZwTvs=; b=ZO2GGzjbk1hAxiCMP4jAvDIQxW+uU4rgHfK7a56dP92c1GH/BJYpxp64VV5/lXqcGr 735FXTVH7JKHRm3u9Sbie9Dyq9/nP8Isd8e885vcq4/gPH6ii4wB9P8aaWFVJ9UMAVon bSZzg9GXDlISEsGVfcIe80CtNlajvnEG6F2T0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=CpYMEEvoYPFanV4iMf2LKvelGCkgg0BmFyNPtolmdhDSpFpZVZSFpbTqoDYsH57EkM lzGC7VDKGgkweOQN5HBH/DDfOijD09Bk0bOsC8notI7cZJadbDeQIz1JR3TQOCAd5z8G aFmTAcO256mDsu+MqUQV+nCtYVrXxl+jo7CHI= MIME-Version: 1.0 Received: by 10.220.97.147 with SMTP id l19mr159085vcn.8.1235147012409; Fri, 20 Feb 2009 08:23:32 -0800 (PST) In-Reply-To: <98EB4A72-76A5-4A9B-BD8C-6F04D26F3D88@mooseyard.com> References: <499EB832.7040704@yahoo.fr> <98EB4A72-76A5-4A9B-BD8C-6F04D26F3D88@mooseyard.com> Date: Fri, 20 Feb 2009 16:23:32 +0000 Message-ID: <46aeb24f0902200823j77134ce2h4aeb84b1289d6863@mail.gmail.com> Subject: Re: What am I doing wrong? From: Robert Newson To: user@couchdb.apache.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org I expect the b-tree wastage is minimal (though not zero). I've wondered what happens on filesystems that don't support sparse files, I assume they'd just be slower and use more disk space. Given that the holes vanish after compaction, I suspected a bad calculation in the code (couch_db.erl, I think), but I've not found it, it seems to do the right thing. HFS+ doesn't support holes but I'm pretty sure NTFS does. Btw, it's mostly around attachments. If you add lots of documents but no attachments, ls and df are in close agreement. B. On Fri, Feb 20, 2009 at 4:00 PM, Jens Alfke wrote: > > On Feb 20, 2009, at 6:03 AM, Pascal Borghino wrote: > >> I am currently compacting it... even if 'Compaction rewrites the databa= se >> file, removing outdated document revisions and deleted documents'... no >> document should be outdate neither deleted... > > In addition to the sparseness of the file, another reason for the size > difference might be obsolete b-tree nodes. The file is append-only, so an= y > time a b-tree changes, the old nodes remain in the file. If you've done a > large number of individual insertions, that space might be significant. > (Probably not gigabytes, though.) > > > robert.newson@gmail.com wrote: > >> I find the actual >> consumed space is far, far less that 'ls' shows. CouchDB .couch files >> are very sparse, large gaps of unwritten data, ostensibly to keep >> btree and document items separate, but these 'holes' vanish after >> compaction, even if you have zero updates and deletes. > > Hm. But not all filesystems support sparse files. HFS+, the Mac OS > filesystem, doesn't. (Does NTFS?) Is there an option to suppress the gaps= ? > > =97Jens