The SQL Server Query That Looks Fast ….Until It Hits Production. Why?
The SQL Server Query That Looks Fast… Until It Hits Production SQL Server Performance Series – Real World Query Pitfalls Hi SQL SERVER Guys, Today we talk about a query pattern that every SQL Server developer has seen at least once. A query that runs perfectly in development. It returns results instantly. Execution plan looks simple. Everyone thinks the problem is solved. Then the code goes to production. and... ...And suddenly the query that ran in milliseconds now takes seconds… or minutes. What happened? The problem is usually not the query itself. The problem is the data. P.S. if you missed my last post: SQL Server Performance Weekly Recap – What You Might Have Missed This Week! The Typical Development Query In your development databases typically the amount of data is often very small. Let's say we write something like this: SELECT * FROM Orders WHERE CustomerID = @CustomerID With a few thousand rows this query looks incred...