You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "jiahuili430 (via GitHub)" <gi...@apache.org> on 2023/12/01 16:54:23 UTC
Re: [PR] Avoid read docs twice when filtered `_changes` is triggered [couchdb]
jiahuili430 commented on code in PR #4862:
URL: https://github.com/apache/couchdb/pull/4862#discussion_r1412359142
##########
src/couch/src/couch_db.erl:
##########
@@ -297,7 +303,13 @@ open_doc(Db, IdOrDocInfo) ->
open_doc(Db, IdOrDocInfo, []).
open_doc(Db, Id, Options) ->
- increment_stat(Db, [couchdb, database_reads]),
+ open_doc(Db, Id, Options, true).
+
+open_doc(Db, Id, Options, ChangeStat) ->
+ case ChangeStat of
+ true -> ?MODULE:increment_stat(Db, [couchdb, database_reads]);
+ false -> ok
+ end,
Review Comment:
Updated the PR to only read docs once when filtering `_change` is triggered.
May I get another review? Thanks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@couchdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org