A load that has been running in about 2 minutes suddenly turned into a 90 minute run before being manually cancelled.
It’s a simple shadow query:
select fields
into shadow_table
from table
where date = '8/23/2011'
date has a non-clustered index on it.
If I change the query to select
top 300000it completes in 2 secondstop 400000it runs in 3 minutestop 500000I got bored waiting and cancelled it
Our server team shows a lot of self blocking while it runs.
Can anyone suggest possible bottlenecks to look at?
Out of date stats.
Self-blocking only occurs with parallelism, and super long parallel runs (compared to norms) ordinarily means out-of-date stats. It could also be a change in cardinality in the data.
Step 1 should be running an
UPDATE STATISTICS WITH FULLSCANon your source table.