-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
distsqlrun: bump index joiner batch size from 100 to 10k #38622
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To amortize the cost of looking up rows, we create a batch of 100 rows to use in one lookup request. Since the relationship is 1:1 in the index joiner (we're doing a lookup on the primary index), the result size is the same size as the request batch. This commit increases the size of this batch to 10k, increasing the result size for each lookup to 10k. This results in some significant performance gains: e.g. tpch query 6 drops to a fifth of its original runtime on a scalefactor 10 dataset due to amortizing lookups. Note that this comes with increased memory usage per request. However, the tableReader limits results for its scans to 10k as well, and there is no good reason to allow normal scans to use more memory than index joiner lookups. In the absence of proper accounting for KV responses, the strategy of allowing index lookups to use the same resources and have the same limitations as normal scans makes sense. Release note: None
friendly ping |
LGTM. It makes me kinda nervous that we have no way to test this. Make sure to pay attention to the nightlies and so on once this goes in. |
bors r=jordanlewis |
Build failed (retrying...) |
Build failed (retrying...) |
Build failed (retrying...) |
craig bot
pushed a commit
that referenced
this pull request
Jul 9, 2019
38622: distsqlrun: bump index joiner batch size from 100 to 10k r=jordanlewis a=asubiotto To amortize the cost of looking up rows, we create a batch of 100 rows to use in one lookup request. Since the relationship is 1:1 in the index joiner (we're doing a lookup on the primary index), the result size is the same size as the request batch. This commit increases the size of this batch to 10k, increasing the result size for each lookup to 10k. This results in some significant performance gains: e.g. tpch query 6 drops to a fifth of its original runtime on a scalefactor 10 dataset due to amortizing lookups. Note that this comes with increased memory usage per request. However, the tableReader limits results for its scans to 10k as well, and there is no good reason to allow normal scans to use more memory than index joiner lookups. In the absence of proper accounting for KV responses, the strategy of allowing index lookups to use the same resources and have the same limitations as normal scans makes sense. Release note: None Co-authored-by: Alfonso Subiotto Marqués <alfonso@cockroachlabs.com>
Build succeeded |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To amortize the cost of looking up rows, we create a batch of 100 rows
to use in one lookup request. Since the relationship is 1:1 in the index
joiner (we're doing a lookup on the primary index), the result size is
the same size as the request batch.
This commit increases the size of this batch to 10k, increasing the
result size for each lookup to 10k. This results in some significant
performance gains: e.g. tpch query 6 drops to a fifth of its original
runtime on a scalefactor 10 dataset due to amortizing lookups. Note that
this comes with increased memory usage per request. However, the
tableReader limits results for its scans to 10k as well, and there is no
good reason to allow normal scans to use more memory than index joiner
lookups. In the absence of proper accounting for KV responses, the
strategy of allowing index lookups to use the same resources and have
the same limitations as normal scans makes sense.
Release note: None