Monday, May 26, 2014

Optimization of Where condition

You would need 2 clustered indexes for best performance, there is only one allowed per table.


BOL: Clustered Index Design Guidelines


QUOTE: "Consider using a clustered index for queries that do the following:




  • Return a range of values by using operators such as BETWEEN, >, >=, <, and <=.


    After the row with the first value is found by using the clustered index, rows with subsequent indexed values are guaranteed to be physically adjacent. For example, if a query retrieves records between a range of sales order numbers, a clustered index on the column SalesOrderNumber can quickly locate the row that contains the starting sales order number, and then retrieve all successive rows in the table until the last sales order number is reached."






Kalman Toth Database & OLAP Architect SQL Server 2014 Design & Programming

New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012









No comments:

Post a Comment