Hi i attached a query plan . This query some times run well , sometimes take more time to execute. Some temp tables are used to store data based upon conditions. Please suggest how to improve performance.
You have to work on getting rid of table scans and keylookups.
Hard to say based on an anonymized estimates-only plan. Provide a post-execution analysis file as a minimum please.
Sorry sir i can not upload full execution plan from office , it contains sensitive information and could be track on servers . Please provide following info that will be use-full :-
if a independent query is used in join and returning for e.g 500 rows , should i use a temp table to store that data and use it in join ?
one table is showing keylookup in excution plan used in dynamic query of 300 lines of code, What should be the best way to add non cluster and covering index instead of looking each column and joins ?
Select b.value from table1 a INNER JOIN table2 b on a.userID = b.userID where b.groupCode = 'cc'
This is a sample query on which table1 is having clustered index on UserID and table2 have non clustered index on columns.
This type of joins we see oftenly and face issue on joined tables like table1.
On table1 clustered index scan runs , even if we add non clustered index it does not convert to seek. Another table uses seek because that columns are used in joins, select and where cluase.
Please suggest .
Just asking for a post-execution plan, i.e. one with actual numbers. You can keep it anonymized of course.
Up to 50 attachments (including images) can be used with a maximum of 209.7 MB each and 209.7 MB total.
Answers and Comments
query plan x670
plan explorer upload x480
index tuning x5
asked: May 14, 2015 at 11:01 AM
Seen: 373 times
Last Updated: May 23, 2015 at 10:34 AM
Query runs endlessly
Same Query, Two Plans, One Stinks
The query is using very heavy CPU. any suggestions please
possible to get MAX() with only an index scan?
Does anyone have any advice on how I should start tuning this thing?
need to reduce cpu cost on query runs quickly but gets called often
How can I make this perform better?
Stored procedure randomly using bad execution plan
Hi, I am in need of help tuning the following section of the query, pasted below.
How to improve the performance of this query where 5 varchar(max) columns are in the SELECT list with only table join to filter out the records based on PK column.
© 2013 SQL Sentry, Inc. All rights reserved.