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 node ids and region to statement stats #102774

Closed
wants to merge 1 commit into from
Closed

sql: add node ids and region to statement stats #102774

wants to merge 1 commit into from

Conversation

j82w
Copy link
Contributor

@j82w j82w commented May 4, 2023

  1. Cache the list of node ids from the dist_sql_planner instance of pasing the tracing statements. This improves the performance, and allows ever request to track the information instead of just the 1% that have tracing enabled.
  2. Cache the list of regions from the dist_sql_planner. This avoids the overhead of looking up the region information again.

Epic: none
Fixes: #102170

Release note (sql change): Adds all node ids and regions used by a
statement to the statement statistics. Previously, only the gateway
node id and region were recorded.

@j82w j82w requested a review from a team May 4, 2023 17:55
@blathers-crl
Copy link

blathers-crl bot commented May 4, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

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

@cockroach-teamcity
Copy link
Member

This change is Reviewable

1. Cache the list of node ids from the dist_sql_planner instance of
    pasing the tracing statements. This improves the performance, and
    allows ever request to track the information instead of just the
    1% that have tracing enabled.
2. Cache the list of regions from the dist_sql_planner. This avoids
    the overhead of looking up the region information again.

Epic: none
Fixes: 102170

Release note (sql change): Adds all node ids and regions used by a
    statement to the statement statistics. Previously, only the gateway
    node id and region were recorded.
@j82w
Copy link
Contributor Author

j82w commented Jul 11, 2023

Closing for a better implementation: #106587

@j82w j82w closed this Jul 11, 2023
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.

sqlstats: "get regions for node" logic is extremely inefficient
2 participants