Home Forums SQL Server 2008 T-SQL (SS2K8) OPTIMIZE FOR UNKNOWN (parameter sniffing problem) RE: OPTIMIZE FOR UNKNOWN (parameter sniffing problem)

  • So it depends mostly on the data in the tables.

    Being a "generic" software spread across the country we can have databases with customers mainly from one state (where a cluster index scan would be better) and also databases witch customer from many different states (where a index seek would be better)..

    But since the query plan will be recompiled the 1st time on each database it will probably be optimized for its case.

    We can have a database where the plan says to use a index scan and another database with the same structure but different data with an index seek...

    There's not much that can be done in these situations since our SW is all over the country (20.000 customers) and each case is specific...

    Thanks,

    Pedro



    If you need to work better, try working less...