I have a couple queries called from a C# .NET web application which are always fast for me (I am an local admin on the SQL Server) but for a group of users (domain group with required permissions), the query is incredibly slow to the point it times out in the application.
What would cause the exact same query to run differently for different users?
- The query is inline SQL in the C# code, not a stored procedure
- The app uses domain authentication and both the user and myself run the query through the app
- Seems like the issue is different plans and one was cached so that is why it was different for different users. Something is affecting the cache because now the query is slow for me via the app and fast in SQL Server Management Studio.