My colleague asked me a question today
"I have a SQL script containing 4 select queries. I have been using it daily for more than a month but yesterday same query took 2 hours and I had to aborting execution."
His questions were
- Q1. What happened to this script on that day?
- Q2. How can I check of those 4 queries which of them got executed and which one culprit for abort?
My answer to Q2 was to use SQL profiler and check trace for Sql statement event.
For Q1: I asked few questions to him
- What was the volume of data on that day? His answer: No change
- Was there any change in indexing i.e. someone might have dropped indexing? His answer: No Change
- Did it trapped in a deadlock by checking data management views to track it? His answer: Not in a deadlock
What else do you think I should have considered to ask? Can there be any other reason for this?
Since I didn't see the query so I can't paste it here.