The Curious Case of… occasional query failure on a tiny table


This is a case that happened on a client system last year: occasionally a common query on a tiny table appeared to ‘hang’ and had to be killed and re-run. What’s going on?

The table in question only had a few million rows of data in it, with a maximum row size of 60 bytes, and the query usually ran in a few seconds, but occasionally the query would ‘hang’ and would either be killed or take tens of minutes to run. Troubleshooting instrumentation when the issue happened showed no out-of-the-ordinary waits occurring, no pressure on the server, and the