incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ganzha Alexey <>
Subject 1 large view vs 2 smaller views
Date Sun, 24 Jul 2011 21:46:48 GMT
I am trying figuring out whats the better.

Say i have a view:

Some users need all docs. And some of them need only docs for the last week.
Just add an attribute 'last_week' in required documents.
Then, in the view i will check this attribute and there are 2 cases:

Filter docs in 1 view


if (doc.last_week)

i will be able to query this view with the additional key member (will user
need all docs, or only last week docs)

Or make 2 separate views. First:


and  Second:

if (doc.last_week)

First case will emit more keys, and the keys will be larger by 1 element.
But in second case, there are 2 views.

What would you prefer. What is the better for performance?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message