Skip to main content

What is Parameter Sniffing and why does it occur?

Entry MS SQL
Quick Answer Parameter sniffing is when SQL Server compiles a stored procedure plan based on the first parameter values it sees. If those values are atypical (e.g., a rare ID vs. a common status), the cached plan is optimal for that one call but terrible for everyone else. Leads to inconsistent query performance.

Answer

SQL Server caches execution plans for reuse.

Parameter sniffing occurs when a cached plan works well for one parameter but poorly for another due to data skew.

S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice