Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

optimize for unknown for SQL Server 2005?

I was listening to the SO podcast and they mentioned Optimize For Unknown for SQL server 2008, they also mentioned that there was something similar for SQL Server 2005. Anyone know what this is?

like image 511
Slee Avatar asked Jul 19 '26 23:07

Slee


1 Answers

As @Mladen Prajdic mentioned, OPTIMIZE FOR UNKNOWN was only introduced in SQL Server 2008.

If you have reasonable knowledge of your query workload, OPTIMIZE FOR can be used to improve query plan caching:

http://blogs.msdn.com/sqlprogrammability/archive/2008/11/26/optimize-for-unknown-a-little-known-sql-server-2008-feature.aspx

http://decipherinfosys.wordpress.com/2007/10/23/optimize-for-query-hint-in-sql-server-2005/

like image 124
Mitch Wheat Avatar answered Jul 22 '26 21:07

Mitch Wheat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!