> On Oct 13, 2015, at 2:16 PM, [email protected] 
> <mailto:[email protected]> wrote:
> 
> But yet I do need to do this  because I have a dynamic query which is nearly 
> impossible get done with only the query api. (I would need to create a lot of 
> views and merge the results)

If this really is a one-shot view that’s just queried once and then deleted, 
then it might be cheaper just to do the work yourself in memory. That is, you’d 
run an all-docs query to iterate over all documents, do your mapping logic on 
each, and collect and sort all the emitted data. This will use more RAM than a 
one-shot query, but you’ll save all the disk I/O of writing the index and then 
reading it back in.

> Any advice on  how  I can speed up execution of the map function on android? 
> For what should I look out? For example I am calling emit a lot for a single 
> document.


Building an index from scratch is inherently expensive — it reads every 
document from disk, parses it, evaluates the map function, serializes the index 
rows and writes them to disk. You can profile your app to see how much of the 
time is being spent in your map function itself.

—Jens

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/5EF1D249-7906-4DD7-BF9D-D3FB97FDC0ED%40mooseyard.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to