Return-Path: Delivered-To: apmail-incubator-couchdb-user-archive@locus.apache.org Received: (qmail 69707 invoked from network); 24 Sep 2008 15:57:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Sep 2008 15:57:31 -0000 Received: (qmail 60880 invoked by uid 500); 24 Sep 2008 15:57:28 -0000 Delivered-To: apmail-incubator-couchdb-user-archive@incubator.apache.org Received: (qmail 60771 invoked by uid 500); 24 Sep 2008 15:57:28 -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 60749 invoked by uid 99); 24 Sep 2008 15:57:28 -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 08:57:28 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jchris@gmail.com designates 209.85.217.19 as permitted sender) Received: from [209.85.217.19] (HELO mail-gx0-f19.google.com) (209.85.217.19) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 15:56:26 +0000 Received: by gxk12 with SMTP id 12so6073962gxk.12 for ; Wed, 24 Sep 2008 08:55:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=hj4VNgIPDXPCPyPE5pEkF+SJxX37h2I+LQQDH6FUf5k=; b=VAbRkGuWrvbmjpHu3irJLaRPIPviIgI31gib8HmujSNS4Q0A2JsOkh/kvu70DUr5Ej j3dUDv2MB4UNuNoZHUGgERSyb36WgOhVgK0nwQo/QeV1ddXQ256lrTDn9a16H70cGnwy vGL6jZjheEIuZPcxAvgHyXqsbJbYtMmDoTd08= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=OKNL4eZoPnT3H78TDMSobz9v4ulYVXP+/Nh0PWCsunzKxtoy8xO4CDpKe8uKO3wAs5 qJtD1aqo4xFlgg255miGRaJLxghullATcj/ZcU7Pw9ZafDUZvsu2Qw8anY+k173j3sRr aa+/mWXnAla/N2otCm4bi4Myy3DjjnzngwyrA= Received: by 10.143.39.16 with SMTP id r16mr2597981wfj.341.1222271759055; Wed, 24 Sep 2008 08:55:59 -0700 (PDT) Received: by 10.142.49.15 with HTTP; Wed, 24 Sep 2008 08:55:59 -0700 (PDT) Message-ID: Date: Wed, 24 Sep 2008 08:55:59 -0700 From: "Chris Anderson" Sender: jchris@gmail.com To: couchdb-user@incubator.apache.org Subject: Re: Newbie questions In-Reply-To: <27d8d0930809240143g33e1b741r96046fd5b2561367@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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-Google-Sender-Auth: 7fdde13b23df7c47 X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Sep 24, 2008 at 1:43 AM, Ayende Rahien wrote: > > 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). > All the data in the files is serialized using term_to_binary (an Erlang built in function). The keys can be non-string, because the sorting (collation) order is defined for all of the valid JSON types (and nested structures). See couch_view:less_json/2 for the sorting code. I think the reuse of btree's for both databases and views is especially elegant, as it means that any optimizations on pulling rows by key, also speed up replication and normal operations. Chris -- Chris Anderson http://jchris.mfdz.com