You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "pgj (via GitHub)" <gi...@apache.org> on 2023/12/10 10:10:27 UTC
[PR] fix(`mango`): communicate rows read for global stats collection [couchdb]
pgj opened a new pull request, #4908:
URL: https://github.com/apache/couchdb/pull/4908
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.
## Testing recommendations
TODO
## Checklist
- [ ] Code is written and works correctly
- [ ] Changes are covered by tests
--
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
Re: [PR] fix(`mango`): communicate rows read for global stats collection [couchdb]
Posted by "pgj (via GitHub)" <gi...@apache.org>.
pgj merged PR #4908:
URL: https://github.com/apache/couchdb/pull/4908
--
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
Re: [PR] fix(`mango`): communicate rows read for global stats collection [couchdb]
Posted by "pgj (via GitHub)" <gi...@apache.org>.
pgj commented on code in PR #4908:
URL: https://github.com/apache/couchdb/pull/4908#discussion_r1426759744
##########
src/mango/src/mango_cursor_text.erl:
##########
@@ -631,10 +619,11 @@ t_execute_more_results(_) ->
),
meck:expect(mango_selector_text, convert, [selector], meck:val(query)),
meck:expect(mango_selector, match, fun(selector, {doc, _}) -> true end),
- ?assertEqual({ok, {acc, 6}}, execute(Cursor, fun foo:normal/2, {acc, 0})),
- ?assertEqual(3, meck:num_calls(couch_stats, increment_counter, 1)),
- ?assertEqual(3, meck:num_calls(mango_execution_stats, incr_docs_examined, 1)),
- ?assertEqual(3, meck:num_calls(mango_execution_stats, incr_results_returned, 1)).
+ meck:expect(chttpd_stats, incr_rows, [0], meck:val(ok)),
Review Comment:
@iilyak, @chewbranca please note that `text` search will not modify the `rows` value. Is this acceptable or shall they also update the value? If yes, how?
--
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
Re: [PR] fix(`mango`): communicate rows read for global stats collection [couchdb]
Posted by "pgj (via GitHub)" <gi...@apache.org>.
pgj commented on code in PR #4908:
URL: https://github.com/apache/couchdb/pull/4908#discussion_r1428502206
##########
src/mango/src/mango_cursor_text.erl:
##########
@@ -631,10 +619,11 @@ t_execute_more_results(_) ->
),
meck:expect(mango_selector_text, convert, [selector], meck:val(query)),
meck:expect(mango_selector, match, fun(selector, {doc, _}) -> true end),
- ?assertEqual({ok, {acc, 6}}, execute(Cursor, fun foo:normal/2, {acc, 0})),
- ?assertEqual(3, meck:num_calls(couch_stats, increment_counter, 1)),
- ?assertEqual(3, meck:num_calls(mango_execution_stats, incr_docs_examined, 1)),
- ?assertEqual(3, meck:num_calls(mango_execution_stats, incr_results_returned, 1)).
+ meck:expect(chttpd_stats, incr_rows, [0], meck:val(ok)),
Review Comment:
I have talked about this with @willholley and @mikerhodes offline. The conclusion was that `rows` should be equal to `reads` for `text` indexes. The distinction between these two categories make difference only for `json` indexes, especially when covering indexes are in use.
--
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