sql server 2005 - Can I trust Execution plans? -


I have these questions:

  CTE (comno) as (separate comno selection select with = company) ID ErpEnterpriseId = ROW_NUMBER () (select command), CTE by comno comno comno = ErpEnterpriseId, RowNo = ROW_NUMBER () (company order by erpEnterpriseId group) over ErpEnterpriseId selection erpEnterpriseId over ROW_NUMBER () (order erpEnterpriseId) RowNo to select so (the company DISTINCT erpEnterpriseId) x  

the three returns similar costs and the actual execution plans..why and how?

When the main thing to try to optimize all the query optimizer is below

a query should, and you should know which one is the best, just try them Compare performance and each version Run a SQL Profiler trace to see term / reads. To compare to average I drive usually 3 times each variant of a query to weed out every time, expulsion plan and data cache Oblique results to stop.

It is worth reading on the adapter.