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