Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 129BB118D5 for ; Wed, 13 Aug 2014 10:02:10 +0000 (UTC) Received: (qmail 54306 invoked by uid 500); 13 Aug 2014 10:02:09 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 54230 invoked by uid 500); 13 Aug 2014 10:02:09 -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 54217 invoked by uid 99); 13 Aug 2014 10:02:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 10:02:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of benjamin.bastian@gmail.com designates 74.125.82.43 as permitted sender) Received: from [74.125.82.43] (HELO mail-wg0-f43.google.com) (74.125.82.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Aug 2014 10:01:42 +0000 Received: by mail-wg0-f43.google.com with SMTP id l18so11097633wgh.14 for ; Wed, 13 Aug 2014 03:01:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=gDmNtt5nBrW3vcjYmyGkqnn+cu8lRwVuy7CWPc4rNww=; b=HYt3nWsZ/0YXNcyFYlxcE9rNVQMUbd+Jo2NhvLhB987bYRqcclVZojsp/9kdSWe3Mz 9+fgfS3Cds7TiFPlJMHtk9J90I6D9SOiwxaB0VXEcVzc0GGvZP3rn4l0wF7TquWJpFPg 6p9cioKusfGScNI3jZ8khnneZ6nb6yUrnjfAUcSrvgaE2bKyY826zyxiVgJ1+BE9gYjN RLMJbFi9htPf38KCgEGRq9Ik4wU36jFOtqNt2yR3u+/FHg+CCc+wyIf9S0HQdns5xYkx yljXmx0zgKR/OnMo2xppOmW196HS0SnVx/BHKxbDNoWKjyuo3/0jUUmBHNdp3Omk1Zb8 1nbw== MIME-Version: 1.0 X-Received: by 10.180.211.71 with SMTP id na7mr32491211wic.14.1407924102099; Wed, 13 Aug 2014 03:01:42 -0700 (PDT) Received: by 10.216.107.4 with HTTP; Wed, 13 Aug 2014 03:01:42 -0700 (PDT) In-Reply-To: References: Date: Wed, 13 Aug 2014 17:01:42 +0700 Message-ID: Subject: Re: View changes API From: "benjamin.bastian@gmail.com" To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=001a11c347e0f9f9ff05007fdfe2 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c347e0f9f9ff05007fdfe2 Content-Type: text/plain; charset=UTF-8 The work-in-progress code is here: https://github.com/sagelywizard/couchdb-couch https://github.com/sagelywizard/couchdb-couch-mrview "working" branch on both repos. For the _view filter, I'd suggest either 1) removing it or 2) leaving it as-is. For doing a view changes query for a range of keys when the key-seq index wasn't enabled, I'd suggest returning an error. "view changes by key not enabled" or some such. On Wed, Aug 13, 2014 at 4:46 PM, Benoit Chesneau wrote: > On Wed, Aug 13, 2014 at 11:27 AM, benjamin.bastian@gmail.com < > benjamin.bastian@gmail.com> wrote: > > > Hey all, > > > > I've been working on merging the view changes functionality from rcouch > > into CouchDB. I've made a few (hopefully) uncontroversial tweaks, but I'd > > like to build some consensus on what the API should look like before I go > > much further. > > > > Thanks :) Where can I see the code? > > > > First of all, the view changes in rcouch endpoint looks like: > > > > /:db/_changes?filter=_view&view=:design/:view > > > > I'd suggest changing this to be something like: > > > > /:db/_design/:design/_view_changes/:view > > or possibly > > /:db/_design/:design/_view/:view/_changes > > > > The main reason the view changes is above is to replace the current > inefficient "_view" filter. Qhat would you do for ths one? Simply removing > it? How would you handle the replication using this filter? > > > > > > Secondly, the merge adds a couple optional flags to the design doc (both > > disabled by default): > > > > 1) A flag to enable most view changes functionality > > 2) A flag to enable efficient querying of the view changes feed over a > > range of keys. (eg. if a view emits keys in the form of [year, month, > day], > > you could query for all the changes which are between [2014, 3, 10] and > > [2014, 3, 20]) > > > > In rcouch, the flag for #1 is called "seq_indexed". That name may be a > bit > > opaque to a user. Maybe something like "enable_changes"? > > > > #2 doesn't exist in rcouch (ie. enabling the "seq_indexed" flag in rcouch > > creates an extra index solely for view changes queries over a range of > > keys). I've talked with some people about making the key+seq index > > independent from the base view changes index. If they were independently > > optional, you'd be able to use the view changes functionality without > > creating an unused key+seq index (or vice versa). I've found that people > > generally think that it's a good idea, but if anyone disagrees, feel free > > to bring it up. I've already implemented the necessary changes for this > > behavior, but I need a good flag name. Maybe "enable_keyed_changes"? > > > > Otherwise, I think it'd be good to reuse the query string/POST body > options > > from the normal _changes endpoint. > > > > without the index, what would be the query on the views changes? Would it > only handle querying the changes by key? (ie not in a range?) > > - benoit > --001a11c347e0f9f9ff05007fdfe2--