Skip to content

release-22.2: opt: set default session settings and cache histograms in benchmarks#98309

Merged
mgartner merged 3 commits intocockroachdb:release-22.2from
mgartner:backport22.2-93482
Mar 9, 2023
Merged

release-22.2: opt: set default session settings and cache histograms in benchmarks#98309
mgartner merged 3 commits intocockroachdb:release-22.2from
mgartner:backport22.2-93482

Conversation

@mgartner
Copy link
Copy Markdown
Contributor

@mgartner mgartner commented Mar 9, 2023

Backport 3/4 commits from #93482.

Informs #98306.

/cc @cockroachdb/release


opt: set default session settings in micro-benchmarks

Setting the default session settings makes the micro-benchmarks more
representative of real-world workloads.

Epic: None

Release note: None

opt: cache histograms in test catalog

Histograms and histogram types are now cached in the test catalog. This
prevents computation and allocations made while building these
histograms from dominating profiles in optimizer micro-benchmarks.

Epic: None

Release note: None

opt: add benchmark for single-column table with histogram

Epic: None

Release note: None

Release justification: This is a test-only change. It prevents the optimizer
benchmarks from showing a huge regression between release-22.2 and
master because of the increase in the join re-ordering limit from 0 (i.e.,
join re-ordering disabled) to 8.

mgartner added 3 commits March 9, 2023 11:38
Setting the default session settings makes the micro-benchmarks more
representative of real-world workloads.

Epic: None

Release note: None
Histograms and histogram types are now cached in the test catalog. This
prevents computation and allocations made while building these
histograms from dominating profiles in optimizer micro-benchmarks.

Epic: None

Release note: None
@mgartner mgartner requested a review from a team as a code owner March 9, 2023 16:40
@mgartner mgartner requested a review from michae2 March 9, 2023 16:40
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Mar 9, 2023

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues or test-only changes.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@mgartner
Copy link
Copy Markdown
Contributor Author

mgartner commented Mar 9, 2023

I'm backporting this so that optimizer benchmarks don't show a huge regression between release-22.2 and master because of the increase in the join re-ordering limit from 0 (i.e., join re-ordering disabled) to 8.

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@mgartner mgartner requested a review from DrewKimball March 9, 2023 16:42
@mgartner mgartner changed the title release-22.2: opt: reduce allocations in Histogram.DistinctValuesCount release-22.2: opt: set default session settings and cache histograms in benchmarks Mar 9, 2023
Copy link
Copy Markdown
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

:lgtm:

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


pkg/sql/opt/bench/bench_test.go line 597 at r1 (raw file):

	// Setup the default session settings.
	h.evalCtx.SessionData().ReorderJoinsLimit = opt.DefaultJoinOrderLimit

Probably doesn't matter, but this has the duplicate ReorderJoinsLimit

@mgartner
Copy link
Copy Markdown
Contributor Author

mgartner commented Mar 9, 2023

pkg/sql/opt/bench/bench_test.go line 597 at r1 (raw file):

Previously, DrewKimball (Drew Kimball) wrote…

Probably doesn't matter, but this has the duplicate ReorderJoinsLimit

I'll fix this on master with #98310 but leave as-is here since it has no impact.

@mgartner mgartner merged commit ae0c3f9 into cockroachdb:release-22.2 Mar 9, 2023
@mgartner mgartner deleted the backport22.2-93482 branch March 9, 2023 20:40
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