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_BlitzLock - Speed up plan cache lookup of deadlock query plans #3311

Closed
erikdarlingdata opened this issue Jul 24, 2023 · 2 comments · Fixed by #3308
Closed

sp_BlitzLock - Speed up plan cache lookup of deadlock query plans #3311

erikdarlingdata opened this issue Jul 24, 2023 · 2 comments · Fixed by #3308

Comments

@erikdarlingdata
Copy link
Contributor

Is your feature request related to a problem? Please describe.
SQL Server is picking some wack query plans when hitting the plan cache looking for SQL Handles related to deadlocked queries

image

Describe the solution you'd like
Drop qualifying rows into an intermediate temp table from sys.dm_exec_query_stats and then get query plans only with those rows.

Describe alternatives you've considered
Updating the #available_plans temp table to make it look like it has a ton of rows in it so the optimizer chooses and eager index spool plan. But that doesn't port to RDS, like we discovered with the #t temp table uses to encourage a parallel plan when reading the XML data.

image

Are you ready to build the code for the feature?
Yes I made it already when working through the same issue with sp_HumanEventsBlockViewer.

@erikdarlingdata erikdarlingdata self-assigned this Jul 24, 2023
erikdarlingdata added a commit to erikdarlingdata/SQL-Server-First-Responder-Kit that referenced this issue Jul 24, 2023
@BrentOzar BrentOzar added this to the 2023-08 Release milestone Aug 15, 2023
@pydss
Copy link

pydss commented Nov 5, 2023 via email

@BrentOzar
Copy link
Member

@pydss to unsubscribe, click the unsubscribe link in the email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants