Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 96031 invoked from network); 9 Oct 2010 19:53:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Oct 2010 19:53:22 -0000 Received: (qmail 36679 invoked by uid 500); 9 Oct 2010 19:53:18 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 36623 invoked by uid 500); 9 Oct 2010 19:53:18 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 36586 invoked by uid 99); 9 Oct 2010 19:53:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Oct 2010 19:53:18 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Oct 2010 19:53:18 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o99JqvS5018010 for ; Sat, 9 Oct 2010 19:52:57 GMT Message-ID: <26956557.60981286653977792.JavaMail.jira@thor> Date: Sat, 9 Oct 2010 15:52:57 -0400 (EDT) From: "Paul Joseph Davis (JIRA)" To: dev@couchdb.apache.org Subject: [jira] Updated: (COUCHDB-707) Proposal for "Filter Views" In-Reply-To: <1906629527.454841269412887225.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/COUCHDB-707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul Joseph Davis updated COUCHDB-707: -------------------------------------- Skill Level: Committers Level (Medium to Hard) > Proposal for "Filter Views" > --------------------------- > > Key: COUCHDB-707 > URL: https://issues.apache.org/jira/browse/COUCHDB-707 > Project: CouchDB > Issue Type: New Feature > Components: JavaScript View Server > Affects Versions: 0.11 > Reporter: Luke Burton > > A common operation I find myself performing repeatedly is: > * request a view (maybe with some basic filter like "keys" or a range of keys) > * in my client, filter this view based on some complex criteria, leaving me with a small set of document IDs (complex as in array intersections, compound boolean operations, & other stuff not possible in the HTTP view API) > * go back to Couch and fetch the complete documents for these IDs. > List Views almost get me to the point of doing this purely in Couch. I can enumerate over a view and do some complex things with it. But I can't output entire documents, unless I use the include_docs=true flag which murders the performance of the list view.Apparently because the entire view is fetched with including docs, THEN passed on to the list view JS. Typically my complex filter criteria is contained in the view itself, so there is no need to fetch the entire document until I know I have a match. > In summary, a Filter View would execute some arbitrary JavaScript on each view row, with access to HTTP request parameters, and return "true" for rows that match. The output would be a list of IDs for whom the function returned true. include_docs=true would include the matching documents. > Performance would certainly not be as good as fetching a raw view, but it would indisputably be better than fetching the entire view over HTTP to a client, deserializing the JSON, doing some stuff, then making another HTTP request, and deserializing more JSON. > I looked at the various entry points for list views in the Couch source. Unfortunately it will take me some time to come up to speed with the source (if I ever have the time ...), and I hope that what I'm asking for could be a simple extension to the List Views for someone very familiar with this area. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.