If a SQL query has parameters, SQL Server creates an execution plan tailored to them to improve performance, via a process called ‚parameter sniffing‘. This plan is stored and reused since it is usually the best execution plan. Just occasionally, it isn’t, and you can then hit performance problems, as Greg Larsen explains.