Experience With When To Use Optimize For Unknown
I have read the theory and views behind SQL Server 2008's 'OPTIMIZE FOR UNKNOWN' query plan option. I understand what it does well enough. I did some limited experiments and found
Solution 1:
You would use it when your data is sufficiently skewed that a plan generated with one parameter value would be completely unsuitable for another potential value of the parameter. i.e. to resolve a parameter sniffing issue.
The remainder of your question doesn't seem particularly relevant to the purpose of the hint or answerable IMO.
Post a Comment for "Experience With When To Use Optimize For Unknown"