Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 54297 invoked from network); 12 Dec 2008 21:14:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Dec 2008 21:14:20 -0000 Received: (qmail 13275 invoked by uid 500); 12 Dec 2008 21:14:31 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 13233 invoked by uid 500); 12 Dec 2008 21:14:31 -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 13222 invoked by uid 99); 12 Dec 2008 21:14:31 -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:14:31 -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.joseph.davis@gmail.com designates 209.85.198.229 as permitted sender) Received: from [209.85.198.229] (HELO rv-out-0506.google.com) (209.85.198.229) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Dec 2008 21:14:10 +0000 Received: by rv-out-0506.google.com with SMTP id g37so1590983rvb.35 for ; Fri, 12 Dec 2008 13:13:50 -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=BvKTST+apuN/WisGzuaR2HbilVvIYB3aHZW95NizVlc=; b=KsU2I+ZbjHbQPGXShWaA+UiohdMqgNjUO5/4cU+WecZ7rqLiBtbT4gjmT2Hx/jK0uz +oGymFSII1UVd8OAI0LipjIAPY1zLqsgSdttX00GiKWR8BRWvP/GJ5p996IL8N0Zkyax ipv50CwaAInmlePNV4doX7IABAGZ1i4PJslWQ= 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=DLuq5VUrUjPL5nb+d7TFQOVrnGnlByaMbXu/plXPtIOaSSDkixD1fym//TkuZjS2ah 7B4+L9k1fmCPaqQeCNi/hanwPIhV+ub6+5JsUH1fHmeHZUp5P7jk4Nv7HdKKXCBTWXxL DjEkXZKZJHKkGTYLrQEJYg5yL+MIXmCov5b6s= Received: by 10.141.176.16 with SMTP id d16mr2124400rvp.120.1229116430586; Fri, 12 Dec 2008 13:13:50 -0800 (PST) Received: by 10.141.79.14 with HTTP; Fri, 12 Dec 2008 13:13:50 -0800 (PST) Message-ID: Date: Fri, 12 Dec 2008 16:13:50 -0500 From: "Paul Davis" 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 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 > >