Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I work on sql server 2012
my execution plan as below
my query is very slow



it not show missing index

so please how to enhance query please ?

What I have tried:

my execution plan
Paste The Plan - Brent Ozar Unlimited®[^]
Posted
Updated 3-Jan-22 22:01pm
Comments
Herman<T>.Instance 3-Jan-22 9:08am    
I just don't click unknown links

1 solution

The execution plan IS showing missing indexes - see the Table Scan for TAllData and again for TPartFeature. Consider using indexes on code, codetypeid, partid and zplid.

But the best way to enhance that query is to get rid of the correlated sub-query - as I told you a month ago After add two statement stuff query executing take long time as 5 minute?[^]
 
Share this answer
 
Comments
_Asif_ 4-Jan-22 5:02am    
Table scanning is not the problem here, check the cost which is 0%. The problem is sorting which is 72% of the cost.
CHill60 4-Jan-22 7:40am    
The problem is actually the correlated sub-query - which is being sorted granted, but it's the reference to the outer query within the sub-query that will be causing the performance issues. OP has already been advised to abstract those out into temporary tables (or CTEs or whatever)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900