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 metric for queries run with optimizer #26981
Conversation
This is nice. Thanks! While you're at it, perhaps print out the value of the metric at the end of logic tests with Reviewed 6 of 6 files at r1. pkg/sql/executor_statement_metrics.go, line 128 at r1 (raw file):
Move this below Comments from Reviewable |
Review status: complete! 0 of 0 LGTMs obtained pkg/sql/executor_statement_metrics.go, line 128 at r1 (raw file): Previously, knz (kena) wrote…
Oh hm. I realize this last comment is based on an undocumented assumption. I think it would be good that you satisfy yourself that:
I also realize as I am writing this that the call to Comments from Reviewable |
I ran into enough roadblocks printing out the value that I don't think it's worth the time right now. Review status: complete! 0 of 0 LGTMs obtained pkg/sql/executor_statement_metrics.go, line 128 at r1 (raw file): Previously, knz (kena) wrote…
done, and opened #27015 Comments from Reviewable |
Reviewed 1 of 1 files at r2. Comments from Reviewable |
Oy I completely forgot something: we also want this to go to the reg server.
|
This is great, but it seems like we might also want to track which statements are actually planned by the optimizer, without falling back to the 2.0 planner. Is there a way to do that? Reviewed 5 of 6 files at r1, 1 of 1 files at r2. Comments from Reviewable |
If we plug the statement stat key like I recommend in my previous comment, the opt and non-opt statements will be counted separately (and reported to our reg server!) That's exactly what we need for PM. |
@rytaft |
Oops sorry I was confused. Yep, this is what I was talking about. It might also be interesting to track the number of queries that fell back, vs. those that were just planned by the 2.0 planner in the first place. Maybe we can already figure that out from settings? Are the cluster/session settings also tracked in the same place? Comments from Reviewable |
Sorry, forgot about this! I think you're right that that's important @rytaft - I added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r3.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but please file my request above in a separate issue, and assign the issue to me and the project "Telemetry". Thank you.
Reviewed 1 of 6 files at r1, 5 of 5 files at r3.
Reviewable status: complete! 1 of 0 LGTMs obtained (and 1 stale)
this one: #26981 (comment) |
TFTR! bors r+ |
Build failed |
Release note (sql change): A new metric sql.optimizer.count has been added which tracks the number of queries with with the experimental cost-based optimizer.
looks like a flake bors r+ |
Build failed |
flake bors r+ |
26981: sql: add metric for queries run with optimizer r=justinj a=justinj Suggested by @knz. Release note (sql change): A new metric sql.optimizer.count has been added which tracks the number of queries with with the experimental cost-based optimizer. 27651: sql: move lease acquisition out of tableState r=vivekmenezes a=vivekmenezes This change removes lease acquisition from the tableState struct and makes lease acquisition a part of LeaseStore. Future work: Move acquireFreshest and release code paths out of tableState. The eventual goal is to have tableState be a simple cache of table descriptors with the leasing code separated out and only responsible for the expiration time of the latest descriptor in the cache. related to #23510 Release note: None Co-authored-by: Justin Jaffray <justin@cockroachlabs.com> Co-authored-by: Vivek Menezes <vivek@cockroachlabs.com>
Build succeeded |
Suggested by @knz.
Release note (sql change): A new metric sql.optimizer.count has been
added which tracks the number of queries with with the experimental
cost-based optimizer.