February 28, 2013 at 6:55 am
Hi ,
One of SP is having below code and it is running more than 2 hrs. This job is daily schedule.
Table_B is truncate and load from souce systems on daily basis.
Number of rows in Table b is morethan 33000000.
On TableA 3 non-clustered indexes are already created.
UPDATE STATISTICS dbo.Table_A
UPDATE STATISTICS dbo.Table_B
Insert into Table_A
(columns...)
Select columns... from Table_B B1
LEFT JOIN Table_A A1 (NOLOCK)
ON B1.[Column1] = A1.[Column1]
AND A1.[SDate] IS NULL
WHERE A1.[Column1] IS NULL
udpate Table_a
.............
.............
I am not sure where I need to debug this issue. While running sp I ran the Profiler on database and ran the DB Tunning Advisor also. But I got only one recommandation on one column on Table A. This column is already tide with non-clustered index . Can any one please advice..
Thanks..
February 28, 2013 at 7:37 am
There is nowhere near enough information to provide anything other than a shot in the dark. Please read the following article about what to post for performance problems. http://www.sqlservercentral.com/articles/SQLServerCentral/66909/[/url]
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 12, 2013 at 10:30 pm
can u please send me your complete SP.
June 6, 2013 at 11:16 am
Not enough information here, but I can guess that this query would benefit from a filter by date on table B. (At the least).
----------------------------------------------------
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply