![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, We have stored proc which select the data from 5 tables by joining and then insert into one table by insert into. When i checked the job i noticed that its taking long time more than 5 hrs. and cmd value in sysprocesses is showing $ins. I checked with apps team and they confirmed that they are dropping the indexes before inserting the data and creating it after inserting the data. the job is takin more that 4 hrs at cmd $ins. |
#3
| |||
| |||
|
|
Hi, We have stored proc which select the data from 5 tables by joining and then insert into one table by insert into. When i checked the job i noticed that its taking long time more than 5 hrs. and cmd value in sysprocesses is showing $ins. I checked with apps team and they confirmed that they are dropping the indexes before inserting the data and creating it after inserting the data. the job is takin more that 4 hrs at cmd $ins. |
#4
| |||
| |||
|
|
Hi, We have stored proc which select the data from 5 tables by joining and then insert into one table by insert into. When i checked the job i noticed that its taking long time more than 5 hrs. and cmd value in sysprocesses is showing $ins. I checked with apps team and they confirmed that they are dropping the indexes before inserting the data and creating it after inserting the data. the job is takin more that 4 hrs at cmd $ins. The first thing to do is to check the query plan of the select statement. The most likely problem is that the select is using a sub-optimal query plan and that this is really what is taking the most time. You can check this by running only the select part of your SQL request with SET SHOWPLAN and SET STATISTICS IO turned on. Post the results here if you want help in analyzing the query plan (along with the source table structure and index definitions) Michael |
#5
| |||
| |||
|
|
Hi, We have stored proc which select the data from 5 tables by joining and then insert into one table by insert into. When i checked the job i noticed that its taking long time more than 5 hrs. and cmd value in sysprocesses is showing $ins. I checked with apps team and they confirmed that they are dropping the indexes before inserting the data and creating it after inserting the data. the job is takin more that 4 hrs at cmd $ins. The first thing to do is to check the query plan of the select statement. The most likely problem is that the select is using a sub-optimal query plan and that this is really what is taking the most time. You can check this by running only the select part of your SQL request with SET SHOWPLAN and SET STATISTICS IO turned on. Post the results here if you want help in analyzing the query plan (along with the source table structure and index definitions) Michael |
![]() |
| Thread Tools | |
| Display Modes | |
| |