couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aurélien Bénel <aurelien.be...@utt.fr>
Subject Re: view problem when using array field items to map the view
Date Wed, 22 Feb 2017 08:09:05 GMT
Hi Dan,

> when we get our seat count up to like 1k elements the view is a disaster to rebuild.
 It pegs the cpu for like a minute. so we changed this to just emit the id of the doc rather
than the doc (…)
> and it rebuilds super fast again.

As a general rule, consider your index as an expensive resource:
don’t put lengthy keys or values if  you don’t really need them. 

As a specific rule, when you need the doc you emitted the key from,
don’t send *any* value (it is already send in the rows as `_id`).

    emit(seat.userID);

Then call the view with `include_docs=true`.


See: http://docs.couchdb.org/en/2.0.0/couchapp/views/collation.html#examples


Regards,

Aurélien
Mime
View raw message