Skip to content
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

sql: expose the number of BatchRequests issued by the fetchers #83365

Merged
merged 2 commits into from
Jun 29, 2022

Conversation

yuzefovich
Copy link
Member

@yuzefovich yuzefovich commented Jun 25, 2022

colfetcher: simplify tracking the number of bytes read

Given the recent cleanup of lifecycles of different fetcher objects, we
can simplify the way we track the number of bytes read by the cFetcher.
Previously, when the cFetcher was used for the index joins, we would
call StartScanFrom which would re-create the underlying KVFetcher, but
now a single object is used throughout the whole operation, so we can
just ask it directly for this statistic. We still close the cFetcher
eagerly in some cases, so we still need to store the statistic
explicitly in such cases.

Release note: None

sql: expose the number of BatchRequests issued by the fetchers

This commit teaches row.KVFetcher to track the number of BatchRequests
issued to perform the reads and then exposes this information along side
other execution statistics like the number of bytes read. I imagine that
this can be handy in some cases, but even more so with the increased
usage of the streamer.

Fixes: #81998.
Addresses: #82156.

Release note (sql change): A new execution statistic that tracks the
number of gRPC calls issued to perform the read operations has been
added to EXPLAIN ANALYZE output. It exposes low-level details that might
aid with debugging the performance of queries for power users.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@yuzefovich yuzefovich force-pushed the count-br branch 2 times, most recently from 2a48a49 to fa15748 Compare June 25, 2022 02:36
@yuzefovich yuzefovich requested review from michae2, cucaroach and a team June 25, 2022 02:37
@yuzefovich yuzefovich marked this pull request as ready for review June 25, 2022 02:37
@yuzefovich yuzefovich requested a review from a team June 25, 2022 02:37
Copy link
Contributor

@cucaroach cucaroach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, 32 of 32 files at r2, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @michae2)

Given the recent cleanup of lifecycles of different fetcher objects, we
can simplify the way we track the number of bytes read by the cFetcher.
Previously, when the cFetcher was used for the index joins, we would
call `StartScanFrom` which would re-create the underlying KVFetcher, but
now a single object is used throughout the whole operation, so we can
just ask it directly for this statistic. We still close the cFetcher
eagerly in some cases, so we still need to store the statistic
explicitly in such cases.

Release note: None
This commit teaches `row.KVFetcher` to track the number of BatchRequests
issued to perform the reads and then exposes this information along side
other execution statistics like the number of bytes read. I imagine that
this can be handy in some cases, but even more so with the increased
usage of the streamer.

Release note (sql change): A new execution statistic that tracks the
number of gRPC calls issued to perform the read operations has been
added to EXPLAIN ANALYZE output. It exposes low-level details that might
aid with debugging the performance of queries for power users.
Copy link
Member Author

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased to resolve the merge conflict.

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @cucaroach and @michae2)

@craig
Copy link
Contributor

craig bot commented Jun 28, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jun 28, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jun 28, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jun 28, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jun 29, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jun 29, 2022

Build failed (retrying...):

@yuzefovich
Copy link
Member Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jun 29, 2022

Already running a review

@craig
Copy link
Contributor

craig bot commented Jun 29, 2022

Build succeeded:

@craig craig bot merged commit 2e1c19b into cockroachdb:master Jun 29, 2022
@yuzefovich yuzefovich deleted the count-br branch June 29, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: consider adding the number of BatchRequests or Batch gRPC calls to execution statistics
3 participants