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: add telemetry counters for generic query plans #127897

Merged
merged 1 commit into from
Jul 31, 2024

Conversation

mgartner
Copy link
Collaborator

Fixes #127651

Release note: None

@mgartner mgartner requested a review from a team July 30, 2024 16:53
@mgartner mgartner requested review from a team as code owners July 30, 2024 16:53
@mgartner mgartner requested review from kyle-a-wong and DrewKimball and removed request for a team July 30, 2024 16:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
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 3 of 3 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @kyle-a-wong and @mgartner)


pkg/sql/plan_opt.go line 573 at r1 (raw file):

	switch opc.p.SessionData().PlanCacheMode {
	case sessiondatapb.PlanCacheModeForceCustom:
		telemetry.Inc(sqltelemetry.PlanTypeForceCustomCounter)

Do you think there could be any impact on performance potentially doing this for every query? Would it be worth doing only on a sampling basis or something?

@mgartner mgartner added backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2 labels Jul 30, 2024
@mgartner
Copy link
Collaborator Author

pkg/sql/plan_opt.go line 573 at r1 (raw file):

Previously, DrewKimball (Drew Kimball) wrote…

Do you think there could be any impact on performance potentially doing this for every query? Would it be worth doing only on a sampling basis or something?

I was worried about that, but we have other counters that are incremented for every query, so I thought this would be no different:

telemetry.Inc(sqltelemetry.JoinAlgoLookupUseCounter)
telemetry.Inc(opt.JoinTypeToUseCounter(join.JoinType))

@mgartner
Copy link
Collaborator Author

TFTR!

bors r+

@craig craig bot merged commit ba114ad into cockroachdb:master Jul 31, 2024
22 checks passed
Copy link

blathers-crl bot commented Jul 31, 2024

Based on the specified backports for this PR, I applied new labels to the following linked issue(s). Please adjust the labels as needed to match the branches actually affected by the issue(s), including adding any known older branches.


Issue #127651: branch-release-23.2, branch-release-24.1.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Copy link

blathers-crl bot commented Jul 31, 2024

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 7e10c1a to blathers/backport-release-23.2-127897: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 23.2.x failed. See errors above.


error creating merge commit from 7e10c1a to blathers/backport-release-24.1-127897: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict []

you may need to manually resolve merge conflicts with the backport tool.

Backport to branch 24.1.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.2.x Flags PRs that need to be backported to 23.2. backport-24.1.x Flags PRs that need to be backported to 24.1. backport-24.2.x Flags PRs that need to be backported to 24.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sql: add generic query plans telemetry counters
3 participants