Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
subhaoviya
Posting Yak Master
135 Posts |
Posted - 2014-06-13 : 12:06:38
|
I have two large tables first table T1 having 41 million records and another table T2 having 20 million records. T1: C1 ,C2 ,C3....C10T2: C2,c11,c13,14...C20table T2 having c2 as foreignkey reference. i am having index on c2 in t2.query:declare @start int,@end int, @cnt intwhile(@start<@cnt)begin set @end=@start+1000 insert into T3 select c1,c2,c14 from t1 inner join t2 on(t1.c2=t2.c2) wheret1.c1>@start and t1.c1<=@end set @start=@endendonly 1 lakhs records gets inserted per min, is it any way to improve its performance?ThanksSubha |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-06-13 : 12:10:39
|
Show us the execution plan for one of the inserts. Also is T1.C2 indexed? How about T1.C1?Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|