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 |
maxyogesh2002
Starting Member
15 Posts |
Posted - 2009-07-16 : 10:05:53
|
Dear Friends Below is my query update Auditdata set tatcalltype='13',CDRcomment=a_sc.Providermaster_idfrom auditdata_scrap1 a_sc inner join auditdata auditdata on a_sc.id=auditdata.idwhere auditdata.tatcalltype is null and a_sc.status='y' the Above SQL Query takes 30 minutes to update the above query contain 2 table1)auditdata contain 15000000 rows2)Auditdata_scrap1 contain 10480000 rowsindex are defined to the columns used for the inner join and where clauseplz help me to make the SQL Query FasterThanx |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-07-16 : 11:05:19
|
[code]set rowcount 10000update xset tatcalltype = '13', CDRcomment = a_sc.Providermaster_idfrom auditdata AS xinner join auditdata_scrap1 as a_sc on a_sc.id = x.idwhere x.tatcalltype is null and a_sc.status = 'y'while @@rowcount > 0 update x set tatcalltype = '13', CDRcomment = a_sc.Providermaster_id from auditdata AS x inner join auditdata_scrap1 as a_sc on a_sc.id = x.id where x.tatcalltype is null and a_sc.status = 'y'set rowcount 0[/code] N 56°04'39.26"E 12°55'05.63" |
|
|
maxyogesh2002
Starting Member
15 Posts |
Posted - 2009-07-16 : 11:32:34
|
Dear Friend Thank for your help.....but this SQL Query also take lot of time to updateset rowcount 10000update xset tatcalltype = '13', CDRcomment = a_sc.Providermaster_idfrom auditdata AS xinner join auditdata_scrap1 as a_sc on a_sc.id = x.idwhere x.tatcalltype is null and a_sc.status = 'y'while @@rowcount > 0 update x set tatcalltype = '13', CDRcomment = a_sc.Providermaster_id from auditdata AS x inner join auditdata_scrap1 as a_sc on a_sc.id = x.id where x.tatcalltype is null and a_sc.status = 'y'set rowcount 0 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-07-16 : 11:38:51
|
"A lot of time" mean less or more than the original 30 minutes? N 56°04'39.26"E 12°55'05.63" |
|
|
maxyogesh2002
Starting Member
15 Posts |
Posted - 2009-07-16 : 11:44:56
|
its takes now 20 minutes... |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-07-16 : 12:06:20
|
Which is 50% faster! N 56°04'39.26"E 12°55'05.63" |
|
|
|
|
|