SQL Server Performance

Order of Execution

Discussion in 'T-SQL Performance Tuning for Developers' started by Madhivanan, Jul 10, 2005.

  1. Madhivanan Moderator

    Select Columns from table where col1='value1' and col2='value2' and col3='value'
    In the above select statement, if col1='value1' is false then there is no need of checking for the other conditions
    Will SQL Server skip further condition if one condition become false or check for all regardless of the result of condition?


    Failing to plan is Planning to fail
  2. satya Moderator

    A SARG limits a search because it specifies an exact match, a range of values, or a conjunction of two or more items joined by AND.

    Satya SKJ
    This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
  3. FrankKalis Moderator

  4. Madhivanan Moderator

    Well. Thanks for the clarification.
    I hope this applies to nested case and OR clauses also


    Failing to plan is Planning to fail

Share This Page