Skip to content

Made filtering by @execution_count be done with a temp table rather than a variable#593

Merged
erikdarlingdata merged 1 commit intoerikdarlingdata:devfrom
ReeceGoding:dev
Apr 28, 2025
Merged

Made filtering by @execution_count be done with a temp table rather than a variable#593
erikdarlingdata merged 1 commit intoerikdarlingdata:devfrom
ReeceGoding:dev

Conversation

@ReeceGoding
Copy link
Contributor

@ReeceGoding ReeceGoding commented Apr 28, 2025

Made filtering by @execution_count be done with a temp table rather than a variable.

This closes #576. In particular, the filter now works at the query level rather than the plan level.

Because this temp table is references by @where_clause, we no longer need @having_clause. Given that @where_clause is used by almost everything, we can now be much more confident that filtering by @execution_count works properly everywhere.

I have to admit that this worked almost too well. The example given in #576 worked correctly on my first try. I don't like it when that happens.

The query that this used was similar to what friend of the repo @zikato suggested. I used window functions instead because I wanted to keep the ways that I was hitting the Query Store DMVs simple.

…han a variable.

This closes #576. In particular, the filter now works at the query level rather than the plan level.
Because this temp table is references by @where_clause, we no longer need @having_clause.
Given that @where_clause is used by almost everything, we can now be much more confident that filtering by @execution_count works properly everywhere.
@erikdarlingdata
Copy link
Owner

@ReeceGoding great work here, thank you!

@erikdarlingdata erikdarlingdata self-requested a review April 28, 2025 18:25
@erikdarlingdata erikdarlingdata added enhancement New feature or request sp_QuickieStore For the loving of Query Store labels Apr 28, 2025
@erikdarlingdata erikdarlingdata merged commit 5118224 into erikdarlingdata:dev Apr 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request sp_QuickieStore For the loving of Query Store

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants