incubator-couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benoit Chesneau (Created) (JIRA)" <j...@apache.org>
Subject [jira] [Created] (COUCHDB-1398) improve view filtering in changes
Date Thu, 02 Feb 2012 23:06:53 GMT
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


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

        

Mime
View raw message