You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Demetrius Nunes <de...@gmail.com> on 2008/08/01 23:44:05 UTC

Is is possible to evaluate a view on top of another view?

Does it make sense do evaluate a view on top of another previously computed
view?

Cheers,

-- 
____________________________
http://www.demetriusnunes.com

Re: Is is possible to evaluate a view on top of another view?

Posted by Chris Anderson <jc...@grabb.it>.
On Fri, Aug 1, 2008 at 2:44 PM, Demetrius Nunes
<de...@gmail.com> wrote:
> Does it make sense do evaluate a view on top of another previously computed
> view?

That's a standard pattern in map/reduce programming. CouchDB doesn't
support it out of the box (managing the cache-expiry on the nested
views is the big challenge).

I've created a script that copies the map index of a view into another
database, for further processing.

http://github.com/jchris/couchrest/tree/master/utils

remap.rb uses CouchRest::Pager to iterate through each unique key in a
view and copy its values to the target database. The only downside is
that you have to drop and recreate the target db when you have new
updates.

We use remapping in my current project to speed up queries that would
otherwise involve a huge client-side query-time join.

-- 
Chris Anderson
http://jchris.mfdz.com