Your SQL Server may be slow for a peculiar reason: a run-away query that pushes-out all other queries from the plan cache, like a huge wave. So called “tsunami query”. Tsunami query wipes other plans from the cache and makes your SQL running slow. Creating tsunami query is easy and usually not intentional: a developer concatenates values in SQL command string. As it “works on my machine”, it easily slips to production (nobody tests for this, right?), and the monster is loose!

In almost every database we have a process that filters the same data with different filters. Typically, query is within a stored procedure that has many filtering parameters that are optional. The problem is – a query optimized builds only ONE plan that will handle every filter combination you throw at it.