Skip to content

colexec: adjust the distribution of randomized batch size#50167

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:adjust-rand-batchsize
Jun 15, 2020
Merged

colexec: adjust the distribution of randomized batch size#50167
craig[bot] merged 1 commit intocockroachdb:masterfrom
yuzefovich:adjust-rand-batchsize

Conversation

@yuzefovich
Copy link
Copy Markdown
Member

This commit adjusts the distribution of randomized batch size to favor
the small sizes yet keeps the possibility of larger sizes as well. Such
distribution is chosen due to the fact that most of our unit tests
don't have a lot of data, so in order to exercise the multi-batch
behavior we favor really small batch sizes. On the other hand, we also
want to occasionally exercise that we handle batch sizes larger than
default one correctly.

Release note: None

This commit adjusts the distribution of randomized batch size to favor
the small sizes yet keeps the possibility of larger sizes as well. Such
distribution is chosen due to the fact that most of our unit tests
don't have a lot of data, so in order to exercise the multi-batch
behavior we favor really small batch sizes. On the other hand, we also
want to occasionally exercise that we handle batch sizes larger than
default one correctly.

Release note: None
@yuzefovich yuzefovich requested review from a team and asubiotto June 12, 2020 22:45
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @yuzefovich)


pkg/sql/colexec/main_test.go, line 100 at r1 (raw file):

		// exercise that we handle batch sizes larger than default one
		// correctly.
		var sizesToChooseFrom = []int{

It might make sense to put this into coldata and reuse here since I think logic tests also attempt to do something similar re distribution and might benefit from just calling this when it's moved into coldata.

Copy link
Copy Markdown
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.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @asubiotto)


pkg/sql/colexec/main_test.go, line 100 at r1 (raw file):

Previously, asubiotto (Alfonso Subiotto Marqués) wrote…

It might make sense to put this into coldata and reuse here since I think logic tests also attempt to do something similar re distribution and might benefit from just calling this when it's moved into coldata.

I disagree with this for a couple of reasons:

  1. currently the method is very easy to use, and the caller can decide on the distribution of random values that suits the caller's needs. If we force the distribution into the method itself, it won't be as flexible.
  2. the distributions in colexec/main_test.go and logic.go are different - note that in colexec we have a minBatchSize prohibiting values of 1 and 2 be used, but in logic.go those are actually quite desirable. If we make an investment in auditing the unit tests in colexec to remove this limitation, then maybe we could unify the two calls.

Copy link
Copy Markdown
Contributor

@asubiotto asubiotto left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @asubiotto)

@yuzefovich
Copy link
Copy Markdown
Member Author

TFTR!

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 15, 2020

Build succeeded

@craig craig bot merged commit c1d0b4a into cockroachdb:master Jun 15, 2020
@yuzefovich yuzefovich deleted the adjust-rand-batchsize branch June 15, 2020 17:27
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.

3 participants