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

sp_QuickieStore: Are the various "last_" columns named as we want them to be? #474

Closed
ReeceGoding opened this issue Oct 6, 2024 · 2 comments
Assignees
Labels
bug Something isn't working sp_QuickieStore For the loving of Query Store

Comments

@ReeceGoding
Copy link
Contributor

Which script is your question about?

Script Name: sp_QuickieStore

Script version

4.9

Is your question about how they work, or the results?

how the scripts work

Okay, what's your question?

Consider the column in the expert mode output called last_cpu_time_ms. When I read that, I think "this is the cpu time in ms from the last time that the plan/query ran". Inspecting the code, we see that it is defined as MAX((qsrs.last_cpu_time / 1000.)) over a grouping of plan_id. That means that it's not the value from the last run, it's the maximum of the last runs over all of the time periods in the time interval we're considering. I discovered this after running sp_QuickieStore multiple times in a day. Each time, I saw the same frighteningly high value in one of the last_ fields even though I knew that the query in question ran hundreds of times per hour. I was very confused. The other various last_ columns share this behaviour.

My question is just "is this behaviour what we want?". I can't call it a bug, because this was quite obviously done on purpose.

IMPORTANT: If you're going to contribute code, please read the contributing guide first.
https://github.com/erikdarlingdata/DarlingData/blob/main/CONTRIBUTING.md

Done that. I'm perfectly happy to contribute, but if my work on finding regressed queries is anything to go by (it's nearly done, I swear!), then you will be waiting months.

@erikdarlingdata
Copy link
Owner

@ReeceGoding I’m happy to accept a correction here. I added these aggregates pretty quickly to solve a problem where execution counts were incorrect.

@erikdarlingdata
Copy link
Owner

Closed via #492

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sp_QuickieStore For the loving of Query Store
Projects
None yet
Development

No branches or pull requests

2 participants