From user-return-9965-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Tue Apr 13 20:06:16 2010 Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 19445 invoked from network); 13 Apr 2010 20:06:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 13 Apr 2010 20:06:16 -0000 Received: (qmail 12862 invoked by uid 500); 13 Apr 2010 20:06:15 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12807 invoked by uid 500); 13 Apr 2010 20:06:15 -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 12799 invoked by uid 99); 13 Apr 2010 20:06:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Apr 2010 20:06:15 +0000 X-ASF-Spam-Status: No, hits=1.7 required=10.0 tests=AWL,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of milu71@gmx.de designates 213.165.64.20 as permitted sender) Received: from [213.165.64.20] (HELO mail.gmx.net) (213.165.64.20) by apache.org (qpsmtpd/0.29) with SMTP; Tue, 13 Apr 2010 20:06:08 +0000 Received: (qmail invoked by alias); 13 Apr 2010 20:05:27 -0000 Received: from e179212021.adsl.alicedsl.de (EHLO wladimir) [85.179.212.21] by mail.gmx.net (mp048) with SMTP; 13 Apr 2010 22:05:27 +0200 X-Authenticated: #48488578 X-Provags-ID: V01U2FsdGVkX1/AAD1SUlHAGP7PLTqWj01apXgs0Gc+CxbnYUDX7k qSbgX/uJh1dB0D Received: by wladimir (sSMTP sendmail emulation); Tue, 13 Apr 2010 22:05:11 +0200 Date: Tue, 13 Apr 2010 22:05:11 +0200 From: Michael Ludwig To: user@couchdb.apache.org Subject: Re: MultiKey sorting in views Message-ID: <20100413200511.GC2548@wladimir> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.2i X-Y-GMX-Trusted: 0 X-FuHaFi: 0.66000000000000003 Pavan Kumar schrieb am 13.04.2010 um 09:33:09 (+0530): > I have documents with author and submitted time ( utc value of > date ) fields . Now i need to sort descending ( i.e latest first ) > on time and filter by author in a view. I think the underlying issue which makes this impossible in CouchDB without add-on is that the engine does just one pass [*] over an index for either an identity or a range query, and there simply isn't any provision for sorting other than by the very index the query uses. [*] My understanding of the engine is very limited, but I guess that a second pass must be performed to merge results from several instances in order to produce a sorted result. Still, this is just a merge, so in the context of sorting, it is a one-pass conceptually. Please correct me if I'm mistaken in any of my half-blind assumptions. -- Michael Ludwig