From couchdb-user-return-1354-apmail-incubator-couchdb-user-archive=incubator.apache.org@incubator.apache.org Wed Sep 24 10:56:31 2008 Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 96294 invoked from network); 24 Sep 2008 10:56:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Sep 2008 10:56:30 -0000 Received: (qmail 46544 invoked by uid 500); 24 Sep 2008 10:56:27 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 46519 invoked by uid 500); 24 Sep 2008 10:56:27 -0000 Mailing-List: contact couchdb-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: couchdb-user@incubator.apache.org Delivered-To: mailing list couchdb-user@incubator.apache.org Received: (qmail 46508 invoked by uid 99); 24 Sep 2008 10:56:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 03:56:26 -0700 X-ASF-Spam-Status: No, hits=3.2 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: 72.14.204.172 is neither permitted nor denied by domain of ayende@ayende.com) Received: from [72.14.204.172] (HELO qb-out-1314.google.com) (72.14.204.172) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 10:55:25 +0000 Received: by qb-out-1314.google.com with SMTP id q13so1744228qbq.26 for ; Wed, 24 Sep 2008 03:55:57 -0700 (PDT) Received: by 10.142.52.9 with SMTP id z9mr2471671wfz.201.1222253756985; Wed, 24 Sep 2008 03:55:56 -0700 (PDT) Received: by 10.142.140.6 with HTTP; Wed, 24 Sep 2008 03:55:56 -0700 (PDT) Message-ID: <27d8d0930809240355t34c27d9dqc18438f81f68484f@mail.gmail.com> Date: Wed, 24 Sep 2008 13:55:56 +0300 From: "Ayende Rahien" To: couchdb-user@incubator.apache.org Subject: Re: Newbie questions In-Reply-To: <27d8d0930809240143g33e1b741r96046fd5b2561367@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_74533_8467098.1222253756973" References: <27d8d0930809231715v379b8d27jd830af5c33ecda8f@mail.gmail.com> <27d8d0930809240053y51780222s4c21f23894d455a1@mail.gmail.com> <078E144E-4C53-45B8-8E36-DE73750A970B@apache.org> <27d8d0930809240115w28b6673bh868bdc292cfcbc7@mail.gmail.com> <27d8d0930809240143g33e1b741r96046fd5b2561367@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_74533_8467098.1222253756973 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline I posted more about the way I understand that btree is working. http://ayende.com/Blog/archive/2008/09/24/more-couchdb-reading-btreelookup.aspx http://ayende.com/Blog/archive/2008/09/24/more-couchdb-reading-btreequery_modify.aspx On Wed, Sep 24, 2008 at 11:43 AM, Ayende Rahien wrote: > On Wed, Sep 24, 2008 at 11:15 AM, Ayende Rahien wrote: > >> On Wed, Sep 24, 2008 at 11:04 AM, Jan Lehnardt wrote: >> >> >>> I have to refer you to Damien or the source for that one. :-) >>> >> >> Trolling the sources now, but it is pretty hard to figure it out. >> > > Okay, here are my current finding. > Views are trees keyed by a different key than the DB. Not sure yet how this > works with regards to sorting on non string data (dates,floats). > > The format of the header of the file is this (for databases, views has > different header): > > Header structure (database): > "gmk\0" > // assuming data is small enough: > db_header: > writer_version > update_seq > summary_stream_state, > fulldocinfo_by_id_btree_state > docinfo_by_seq_btree_state > local_docs_btree_state > purge_seq > purged_docs > // zero padding to 2048 > md5 (including zero padding) > > // else if data is too big > pointer_to_header_data, position in file > // zero padding to 2048 > md5 (including zero padding) > > > notes: > - append_binary leaves the current file position in an undefined position > (see pwrite documentation), but it looks like that is not handled in the > code. > - I am not seeing the header written twice, I am seeing it always written > to pos 0, never to pos 2048 > > more to follow > ------=_Part_74533_8467098.1222253756973--