Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 56749 invoked from network); 12 Dec 2008 21:19:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2008 21:19:45 -0000 Received: (qmail 18868 invoked by uid 500); 12 Dec 2008 21:19:57 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 18826 invoked by uid 500); 12 Dec 2008 21:19:56 -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 18815 invoked by uid 99); 12 Dec 2008 21:19:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 13:19:56 -0800 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 paul.p.carey@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 21:19:36 +0000 Received: by ug-out-1314.google.com with SMTP id c2so382323ugf.31 for ; Fri, 12 Dec 2008 13:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=SkMQ9sjhtkIqjQWxDS4Tx1tX1vPzj5ORtI0mwBySVv0=; b=AG0EUmuy/0uJle9Z5Bs92wI0Hx0fKVWrbn6E5zKkncb9PlpEmIAdhNB4PbfLEOWJv0 oVY3xitQc6ZXm68b/TK4z4bZ3FZEg36O5VdjfTg4p9g7HXqwl34PZKQrDV5RYsJFfXV7 9VAyi/c1Ev2veRrrgKlCh0D1utG7BIJe8rzxQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=V0o0t4xoAmXyNkvYLrhVLYvaLnWt9G28JvdOjcR244LBg4Bp17lEMiMl0vQLHgy1oE F+La6PPEgUdYCqJKxMA/Tqv+dqeiSHF3u8GJGsH0iUTpeShLkeMubjD9KbxK4ixWcfex QEefN5rfkbkS0kpq+hsORrC1ndBMkNkaR4Fmo= Received: by 10.66.241.13 with SMTP id o13mr60941ugh.31.1229116754887; Fri, 12 Dec 2008 13:19:14 -0800 (PST) Received: by 10.67.27.6 with HTTP; Fri, 12 Dec 2008 13:19:14 -0800 (PST) Message-ID: <13ae4dd50812121319l71a1e9ecva1e0da997ecaa96a@mail.gmail.com> Date: Fri, 12 Dec 2008 21:19:14 +0000 From: "Paul Carey" To: user@couchdb.apache.org Subject: Re: Array key queries In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <13ae4dd50812121259r492a925dkf7ee9fe8388a0868@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Adam, Paul Thanks for the quick replies, very helpful. Paul On Fri, Dec 12, 2008 at 9:13 PM, Paul Davis wrote: > On Fri, Dec 12, 2008 at 4:09 PM, Adam Kocoloski > wrote: >> Hi Paul, yes it is. The startkey/endkey filtering can only select a >> continuous range in the keyspace, and the keys are sorted by the first >> element in the array (first). If you happened to have row in that view with >> a key [{}, 1], your second query would have suppressed it. >> >> I realize that filtering on an arbitrary position in the array would be >> sweet, but it would be quite a lot more work for the server. I'm not a >> member of the development team, but I'll bet that kind of functionality will >> only appear if CouchDB's flavor of MapReduce grows support for a remap >> phase. Best, >> > > On a side note, one of my github branches is a custom sort order patch > for views that allows for declaring ascending or descending sort order > for each position in an array key. > >> Adam >> >> On Dec 12, 2008, at 3:59 PM, Paul Carey wrote: >> >>> Querying with an array based key produces inconsistent results across >>> different key indexes. >>> >>> For example, consider a view that emits the following keys >>> >>> [0, 0] >>> [0, 1] >>> [1, 0] >>> [1, 1] >>> >>> Querying with startkey=[0, null] and endkey=[0, {}] returns >>> >>> [0, 0] >>> [0, 1] >>> >>> However, querying with startkey=[null, 0] and endkey=[{}, 0] does not >>> return >>> >>> [0, 0] >>> [1, 0] >>> >>> Instead, all rows are returned. >>> >>> Is this the expected behaviour? >>> >>> Thanks >>> Paul >> >> >