Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Insert, Select on same table


Insert, Select on same table

Author
Message
bharadwaj.manchu
bharadwaj.manchu
Grasshopper
Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)Grasshopper (13 reputation)

Group: General Forum Members
Points: 13 Visits: 122
I have two jobs running. Job2 is kicked off after 3 mins of start of job1. Job1 has a long running step where it inserts and updates a table. Job2 has a step in which a query like where not exists( select from the same table udated in job1 ). Job2 which takes normally 4 to 5 mins to run, but when it has to run simultaneously with job1, it takes more than 40 minutes.
This process has been running like this since years, no blocking or locking issues are recorded and job2 never had dirty reads. I am investigating the root cause of over running of Job2. I found that job 2 waiting at the same step where it has to select data from the same table. Now I need to know if this is the reason or could be any other. Please advice.
Steve Jones
Steve Jones
SSC-Dedicated
SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)SSC-Dedicated (36K reputation)

Group: Administrators
Points: 36318 Visits: 18752
You are using "same" a few times and it's not clear what you are referring to.

If there is a conflict of resources between the jobs, it could be blocking. It doesn't matter if it worked well in the past, if data size/skew changed, it's possible that the jobs are executing at the same time and slowing each other down.

Follow me on Twitter: @way0utwest
Forum Etiquette: How to post data/code on a forum to get the best help
My Blog: www.voiceofthedba.com
Jason Selburg
Jason Selburg
SSCrazy
SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)SSCrazy (2.8K reputation)

Group: General Forum Members
Points: 2803 Visits: 4101
if my interpretation of your "same" references, it is highly likely that the "inserts and updates" in job (1) are locking the table. Why not move the steps in job (2) to the end of job (1)'s job. In other words, keep job (2) from starting until job (1) is complete.

______________________________________________________________________

Personal Motto: Why push the envelope when you can just open it?

If you follow the direction given HERE you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search