title: SQL Server query hangs on first execution
body: <p>I have a .NET application using an SQL Server backend. There are deployments using all versions of SQL Server from 2008 to 2017 on clients running Windows 7 through to 10. Both 32 and 64 bit systems are used. Mostly the application runs as standalone with server and client on the same machine. Some deployments use Windows Server 2012. </p>
  
  <p>There is one such instance (Windows 7, 32 bit, SQL Server 2014 SP2 CU10) where the first time a query is executed via a stored procedure, it hangs for about 10-15 seconds. Subsequent executions occur instantaneously. It is a simple SELECT COUNT(*) query that typically returns a value of 0-2 using the ExecuteScalar method. I cannot replicate this particular issue on any other machine. What is it that might be causing this to occur in an isolated instance?</p>