couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tito Ciuro <tci...@mac.com>
Subject Re: Which view is better optimized ?
Date Tue, 22 Jul 2014 17:02:23 GMT
Is it better then to define a view per design doc then? If I have say, 8 views for a given
person design doc, would you place them in one single doc or break them into smaller units?

-- Tito


> On Jul 22, 2014, at 9:45, Mike Marino <mmarino@gmail.com> wrote:
> 
> Multiple views also allows you to split them across design documents, which
> means they can be built independently and in parallel.
> 
> 
>> On Tue, Jul 22, 2014 at 5:44 PM, Jens Alfke <jens@couchbase.com> wrote:
>> 
>> 
>> On Jul 22, 2014, at 2:51 AM, Landry Soules <landry.soules.cn@gmail.com>
>> wrote:
>> 
>>> My question is : is it more efficient to create a single view containing
>>> several emit, for example:
>>> emit([doc.age, doc.gender, doc.lastSeen], doc);
>>> emit([doc.gender, doc.age, doc.lastSeen], doc);
>>> or to create several views, each of them containing one emit statement ?
>> 
>> Creating several views is probably better, since each one will be slightly
>> faster to search. Also, with one view you can easily get mixed up between
>> different types of keys — for example, if you emit both doc.gender and
>> doc.name as keys, and both are strings, then the “F” gender rows are
>> going to appear in between the names that start with “E” and “F”, which
>> sounds like a mess.
>> 
>> —Jens

Mime
View raw message