I have been asked the following question in one of SQL interviews:
"An application issues an UPDATE statement to a table. But the UPDATE query never ends i.e it is going on for ever. What might be the reason?"
I gave various reasons:
--> May be the table is blocked by some other query.
--> May be the query is updating a huge chunk of data.
--> May be appropriate indexes are not created on the table.
--> May be the indexes are defragmented.
--> May be the statistics on the table need to be updated.
--> May be the server is too busy to process the request.
But the interviewer said all the above conditions are satisfied i.e. the query is updating only 100K rows and the table has appropriate rebuilt indexes with statistics updated and the server is not very busy. There is no blocking as well.
What else could be the reason?
View Complete Post