Github user eiri commented on a diff in the pull request:
https://github.com/apache/couchdb-couch-mrview/pull/72#discussion_r107318756
--- Diff: src/couch_mrview.erl ---
@@ -653,6 +653,18 @@ make_meta(Args, UpdateSeq, Base) ->
end.
+get_total_rows(#db{local_tree = LocalTree} = Db, #mrargs{extra = Extra}) ->
+ case couch_util:get_value(namespace, Extra) of
+ <<"_local">> ->
+ FoldFun = fun(_, _, Acc) -> {ok, Acc + 1} end,
+ {ok, _, Total} = couch_btree:foldl(LocalTree, FoldFun, 0),
--- End diff --
Nope, `couch_btree:size/1` returns active size of btree in bytes and we
need number of documents. For id btree we are taking advantage of the fact that
we are keeping this info on full reduction in tree's root, but unfortunately we
don't do that for local btree, so I have to fold here.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---