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 that with a warm cache, it only was of benefit on > 100k rows. However, this was on a simple table and query with no joins, filtering, etc. On a cold cache, the picture would undoubtedly be much more in its favor. I don't currently have a production system to bench the before/after. So I am curious if anyone has