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 D4EAB9AC0 for ; Wed, 15 Feb 2012 12:53:25 +0000 (UTC) Received: (qmail 96857 invoked by uid 500); 15 Feb 2012 12:53:25 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 96799 invoked by uid 500); 15 Feb 2012 12:53:25 -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 96790 invoked by uid 99); 15 Feb 2012 12:53:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Feb 2012 12:53:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 15 Feb 2012 12:53:21 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 2D2971B8C3F for ; Wed, 15 Feb 2012 12:53:01 +0000 (UTC) Date: Wed, 15 Feb 2012 12:53:01 +0000 (UTC) From: "Benoit Chesneau (Commented) (JIRA)" To: dev@couchdb.apache.org Message-ID: <918410918.40476.1329310381186.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2009596994.5464.1328224013894.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (COUCHDB-1398) improve view filtering in changes 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-1398?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208441#comment-13208441 ] Benoit Chesneau commented on COUCHDB-1398: ------------------------------------------ Hi Filipe, Thanks for the review, I will address issues later. Just quick comments : 1) I will fix that. I prefer this indentation to the other since it distinct the fun from other level. But will comply with common style, np :) 2) I thought opening the ddoc each time was enough to handle the ddoc changes. Isn't raising an exception enough to stop the feed? But of course checking if the ddoc has changed may be better at this point. I will have a look. Also errors should be probably catched. 3) In fact I'm eagerly waiting for an event hub in couch. Where you can publish any event and subscribe too it. I started to use couch_event from @davisp but stopped at some point since I wasn't sure it was the correct solution. To minimize the code base, I just reuse the current event handler. I've no strong opinion on it. Do you think it's really needed? 4) Manual replications tests worked. The `_view` filter is already tested. I will add tests to address cases where you already have doc, when ddoc disapear & such. Again thanks for the review. > improve view filtering in changes > --------------------------------- > > Key: COUCHDB-1398 > URL: https://issues.apache.org/jira/browse/COUCHDB-1398 > Project: CouchDB > Issue Type: Improvement > Components: View Server Support > Affects Versions: 2.0, 1.3 > Reporter: Benoit Chesneau > Labels: changes, view > Attachments: 0001-white-spaces.patch, 0002-initial-step-move-the-code-from-couch_httpd_db-to-co.patch, 0003-fix-indent.patch, 0004-This-wrapper-is-useless-somehow-split-the-code-in-a-.patch, 0005-add-view_updated-event.patch, 0006-immprove-view-filter.patch, 0007-useless-info.patch, 0008-whitespaces.patch, 0009-handle-native-filters-in-views.patch > > > Improve the native view filter `_view` support by really using view index. This patches add following features > - small refactoring: create the couch_httpd_changes modules, to put all the changes http support in its own module instead having it in couch_httpd_db. > - add the `view_updated` event when a view index is updated : {view_updated, {DbName, IndexName}} > - start the feed using results in the view index instead of all the db index > - only react on view index changes. > For now next changes are still get using the couch_db:changes_since function and passing the map function to the results. It could be improved if we had a by_seq btree in the view index too. Other way may be to skip a number of the documents already processed. Not sure it would be faster. Thoughts ? > The branch couch_view_changes in my repo contains preliminary support: > https://github.com/benoitc/couchdb/tree/couch_view_changes > Diff: > https://github.com/benoitc/couchdb/compare/master...couch_view_changes > To use it, use the native filter named _view which take the parameter view=DesignName/Viewname > eg: > http://server/db/_changes?feed=continuous&heartbeat=true&filter=_view&view=DesignName/SomeView > It has also an interresting side effect: on each db updates the view index refresh is triggered so view updates are triggered. Maybe we could introduce an optionnal parameter to not trigger them though? -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira