New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

basic execution statistics for _find #768

Merged
merged 4 commits into from Aug 30, 2017

Conversation

Projects
None yet
3 participants
@willholley
Member

willholley commented Aug 22, 2017

Overview

Accept an "execution_stats" parameter to _find. If present, return a new "execution_stats" object in the response which contains information about the query executed. Currently, this is only
implemented for json/all_docs indexes and contains:

  • total key lookups
  • total document lookups (when include_docs=true used)
  • total quorum document lookups (when fabric doc lookups used)

Testing recommendations

Query _find with different selectors. Add "execution_stats":true to the request body and see that an "execution_stats" field is returned. Test with different index types.

This PR adds new unit tests for the execution stats and existing behaviour is already well covered by tests.

GitHub issue number

Related Pull Requests

Checklist

  • Code is written and works correctly;
  • Changes are covered by tests;
  • Documentation reflects the changes;
% License for the specific language governing permissions and limitations under
% the License.
-record(execution_stats, {

This comment has been minimized.

@tonysun83

tonysun83 Aug 22, 2017

Contributor

consider changing Lookup to Fetched? It's not a huge deal, but the word lookup seems indicate key range executions search execution vs rows returned.

@tonysun83

tonysun83 Aug 22, 2017

Contributor

consider changing Lookup to Fetched? It's not a huge deal, but the word lookup seems indicate key range executions search execution vs rows returned.

This comment has been minimized.

@willholley

willholley Aug 23, 2017

Member

@tonysun83 ideally the key lookup counter would be as you describe - it's just not implemented that way yet (code assumes key lookups == doc lookups until we have covering indexes). Note that the current counters don't say anything about the number of rows returned - just the number of internal row / document fetches.

@willholley

willholley Aug 23, 2017

Member

@tonysun83 ideally the key lookup counter would be as you describe - it's just not implemented that way yet (code assumes key lookups == doc lookups until we have covering indexes). Note that the current counters don't say anything about the number of rows returned - just the number of internal row / document fetches.

This comment has been minimized.

@willholley

willholley Aug 23, 2017

Member

@tonysun83 I've renamed these to xxExamined

@willholley

willholley Aug 23, 2017

Member

@tonysun83 I've renamed these to xxExamined

@tonysun83

This comment has been minimized.

Show comment
Hide comment
@tonysun83

tonysun83 Aug 22, 2017

Contributor

overall looks pretty good with some minor nitpicks.

Contributor

tonysun83 commented Aug 22, 2017

overall looks pretty good with some minor nitpicks.

@garrensmith

This is looking awesome. Just some small changes.

Show outdated Hide outdated src/mango/src/mango_cursor_text.erl
Show outdated Hide outdated src/mango/src/mango_cursor_text.erl
Show outdated Hide outdated src/mango/src/mango_cursor_view.erl
Show outdated Hide outdated src/mango/src/mango_httpd.erl
Show outdated Hide outdated src/mango/test/15-execution-stats-test.py

willholley added some commits Aug 22, 2017

basic execution statistics for _find
Accept an "execution_stats" parameter to _find. If present, return
a new "execution_stats" object in the response which contains
information about the query executed. Currently, this is only
implemented for json/all_docs indexes and contains:
 - total keys examined (currently always 0 for json indexes)
 - total documents examined (when include_docs=true used)
 - total quorum documents examined (when fabric doc lookups used)
Add execution time to mango execution stats
Include execution time in mango execution stats. Only implemented for views.

@garrensmith garrensmith merged commit af839e1 into apache:master Aug 30, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@willholley willholley referenced this pull request Aug 30, 2017

Merged

API documentation for mango execution stats #160

0 of 3 tasks complete

willholley added a commit to willholley/couchdb that referenced this pull request Sep 5, 2017

basic execution statistics for _find (#768)
Accept an "execution_stats" parameter to _find. If present, return
a new "execution_stats" object in the response which contains
information about the query executed. Currently, this is only
implemented for json/all_docs indexes and contains:
 - total keys examined (currently always 0 for json indexes)
 - total documents examined (when include_docs=true used)
 - total quorum documents examined (when fabric doc lookups used)

wohali added a commit that referenced this pull request Oct 19, 2017

basic execution statistics for _find (#768)
Accept an "execution_stats" parameter to _find. If present, return
a new "execution_stats" object in the response which contains
information about the query executed. Currently, this is only
implemented for json/all_docs indexes and contains:
 - total keys examined (currently always 0 for json indexes)
 - total documents examined (when include_docs=true used)
 - total quorum documents examined (when fabric doc lookups used)

willholley added a commit to willholley/couchdb that referenced this pull request May 22, 2018

basic execution statistics for _find (#768)
Accept an "execution_stats" parameter to _find. If present, return
a new "execution_stats" object in the response which contains
information about the query executed. Currently, this is only
implemented for json/all_docs indexes and contains:
 - total keys examined (currently always 0 for json indexes)
 - total documents examined (when include_docs=true used)
 - total quorum documents examined (when fabric doc lookups used)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment