sql server - Sporadic SQL Timeouts with joins, good index -
i have query timeouts in instances not others. using sql server 2008, mvc3, ef.
the query rather large (ef code), however, after investigating in qa using exact query that's in profiler), branches use index seek. it's 2 or 3 table join, depending on query (about 4 different ones, 4 variations each based on column i'm querying on). tables have 400k, 100k, 1.2m rows. however, timeouts on 400k - 100k join. paging 50 records @ time, i'm getting timeouts on count as, well.
i looking advice on how determine what's causing timeout. since runs , displays on page within 5 seconds in instances , timeouts on others, don't think it's query. rather not increase timeout threshold.
i have tried using reports in ssms looking blocking transactions, resource locking, have set read not commited, looked @ profile tables...
the 1 thing suspect these tables updated daily, once - utilizing larg delete , bulk import. statitics off or index? rebuild of these index nightly, not sure on these tables. there way verify case? rebuild index after import time, wouldn't downtime , it's better sporadic timeouts. i'm still not sure if it's this.
i advise doing reorganize on index (so still stays online users) straight after import see if helps. check fragmentation of indexes after import see state in , if or not.
another thing can think of, off top of head queries may affected dop (degrees of parrallesism < can never spell word sorry :( ), have @ each query timing out, taking @ it's query plan. if hover on lines join's etc see estimated number of rows vs actual number of rows. if, example, expecting 500k rows returning 10 rows, sqlserver on complicating queries execution plan.
we can alter way query runs using query hints (msdn link)
hth,
stu
Comments
Post a Comment