couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Lehnardt (JIRA)" <>
Subject [jira] [Commented] (COUCHDB-1270) Rewrite the view engine
Date Tue, 06 Sep 2011 15:34:12 GMT


Jan Lehnardt commented on COUCHDB-1270:

Paul, outstanding work!

I'm still reading, but here are a few things questions that come up for me. (I expect most
of these to stem from my inexperience with the current view engine).

In swap_compacted/2 you first unlink the old and then link the new fd. I'm unsure about the
specifics, but what happens in case of a crash in the middle? Would linking the new one first
and unlinking the old one after that make any difference?

Turns out "few" meant "one".

Finally, some style nitpicks. Some of your chosen symbol names are "too short" for my taste,
but then I tend to be of the very_verbose_camp. Consider all of this a bike shed.

view_cb -> view_callback (and other _cbs)
red_fold -> reduce_fold
mrst -> mrstate / mr_state? (although only in the declaration, when in use it is usually
couch_mrview_http.erl -> we tend to use "httpd" in file names. I'm happy to break with
that tradition if we have a good reason :)
ad_skey_opts -> all_docs_start[_]key_opts

Again, great work Paul!

@Benoit, you wrote "Also just wanted to say I really like the current design.", do you mean
you like Paul's design or the "old" view engine?

> Rewrite the view engine
> -----------------------
>                 Key: COUCHDB-1270
>                 URL:
>             Project: CouchDB
>          Issue Type: Improvement
>          Components: JavaScript View Server
>            Reporter: Paul Joseph Davis
>         Attachments: 0001-Minor-changes-for-new-indexing-engine.patch, 0002-Create-the-couch_index-application.patch,
0003-Create-the-couch_mrview-application.patch, 0004-Remove-the-old-view-engine.patch
> The view engine has been creaky and cluttered. As shown by GeoCouch, adding new indexers
basically involves copying the entire view engine and hacking the parts that are different.
In short, the opposite of good engineering.
> Over the last couple weeks I've refactored the view engine and reimplemented the map/reduce
view engine. These changes are 100% internal and no external behavior has changed. Performance
is just a tiny bit better than trunk. I did do some playing trying to improve view update
times and there are some dances we could do, but for the time being I wanted to keep the same
general architecture for updates so that the changes are minimal.

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message