couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wojciech Kaczmarek <kaczmare...@gmail.com>
Subject Re: View Filter
Date Tue, 19 May 2009 12:24:09 GMT
Just 2 cents

On Fri, May 15, 2009 at 09:38, Brian Candler <B.Candler@pobox.com> wrote:
[cut]
> It might be possible to make the feature more general though. For example,
> suppose each view had its own filter, and the erlang server took the *union*
> of those filters to work out which documents to send. Then, when sending a
> document, it sent a list of which views to process it with. This could be
> used to simplify the view code by removing the doc.type test, whilst getting
> the performance benefit automatically.

+1.
I think this optimization is not premature, and need for it emerged
from experiences of many. It seems sane to limit the number of docs
sent to the view server and speed up the calculation of view indexes
this way.

> Example:
>
>  views:{
>    view1:{
>      filter:[{type:"foo"}],
>      map:...
>    }
>    view2:{
>      filter:[{type:"foo"},{type:"bar"}],
>      map:...
>    }
>  }
>
> When a document of type foo is sent, it would be sent to the view engine
> with a list ["view1","view2"] of the views to be invoked on it. A document
> of type bar would have ["view2"]. A document of type baz would not be sent
> at all.
>
> But maybe this is too complicated, and going further down this route ends up
> with an erlang view server anyway.

+1 ;-]

cheers,
Wojtek

Mime
View raw message