Home Forums SQL Server 2008 SQL Server 2008 - General What is proper way of indexing on a table which contain large amount of data RE: What is proper way of indexing on a table which contain large amount of data

  • Anuj Rathi (2/8/2013)


    "If you have a WHERE clause that includes expressions connected by two or more AND operators, SQL Server will evaluate them from left to right in the order they are written. This assumes that no parenthesis have been used to change the order of execution. Because of this, you may want to consider one of the following when using AND:

    Locate the least likely true AND expression first. This way, if the AND expression is false, the clause will end immediately, saving time.

    If both parts of an AND expression are equally likely being false, put the least complex AND expression first. This way, if it is false, less work will have to be done to evaluate the expression.

    You may want to consider using Query Analyzer or Management Studio to look at the execution plans of your queries to see which is best for your situation. [2000, 2005, 2008] Updated 2-4-2009 "

    That's a load of complete hogswash.

    Operators are not evaluated from left to right, if an expression if false the evaluation does not end.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass