couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <>
Subject Re: sort by key
Date Tue, 22 Sep 2009 21:23:56 GMT

On 22 Sep 2009, at 18:39, Elf wrote:

> 2009/9/22 Ning Tan <>:
>> On Tue, Sep 22, 2009 at 11:43 AM, Elf <> wrote:
>>> Do not use emit(something, doc), prefer to use include_docs=true  
>>> (so,
>>> emit(something, something_less_than_large_document) when  
>>> requesting a
>>> view.
>> Can you elaborate on this? What if I have a mostly read database  
>> (i.e.
>> I don't care too much about view update time and space limitation,
>> etc) and want to get to the data very quickly? Having to use
>> include_docs means internally I need to query a second b-tree to get
>> the data, right?
> So, I will recommend you to store documents in a view :-)
> But topicstarter is novice in couchdb, so I can't recommend that  
> tactics for it.
> Also, I think, second b-tree lookup is not a bottleneck. Bottleneck
> may be disk or network bandwidth, so... It's need to test your
> environment, not to guessing.

It'd be a secondary b-tree lookup per view result row. So this is a  
significant hit
on view read time). Emitting the full doc is also a significant hit  
(on view index
time). Emitting only the values you need from a view is best for both  
cases :)


View raw message