couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Marino <mmar...@gmail.com>
Subject Re: Which view is better optimized ?
Date Tue, 22 Jul 2014 16:45:17 GMT
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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message