Skip to content

Commit

Permalink
mango: communicate rows read for global stats collection
Browse files Browse the repository at this point in the history
Besides the execution statistics that could be shown for the user,
the number of rows and documents read are tracked separately on
the global level.  (Which is more like a bug than a feature, but
that is out of the scope of this change.)

With the introduction of covering indexes, these two have been
become different, therefore global counting has to be taught about
the number of times when no documents were read but rows only.
  • Loading branch information
pgj committed Dec 10, 2023
1 parent ce27697 commit 5bbefac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mango/src/mango_execution_stats.erl
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ log_end(Stats) ->
maybe_add_stats(Opts, UserFun, Stats0, UserAcc) ->
Stats1 = log_end(Stats0),
couch_stats:update_histogram([mango, query_time], Stats1#execution_stats.executionTimeMs),
%% TODO: add rows read when we collect the stats
%% TODO: add docs vs quorum docs
chttpd_stats:incr_rows(Stats1#execution_stats.totalKeysExamined),
chttpd_stats:incr_reads(Stats1#execution_stats.totalDocsExamined),

FinalAcc =
Expand Down

0 comments on commit 5bbefac

Please sign in to comment.