[dba-SQLServer] SQL Server WHERE Clause order

jwcolby jwcolby at colbyconsulting.com
Mon May 5 08:44:54 CDT 2008


Thanks Arthur.

John W. Colby
www.ColbyConsulting.com


Arthur Fuller wrote:
> Generally the optimizer will figure it out depending on available indexes.
> For a more complex query you might have to specifically order the WHERE
> clause according to the indexes, but you can always check what's happening
> using the optimizer.
> 
> A.
> 
> On Mon, May 5, 2008 at 9:06 AM, jwcolby <jwcolby at colbyconsulting.com> wrote:
> 
>> Does it make any difference in SQL Server the order of the WHERE clause
>> items.  For example:
>>
>> WHERE (LastName IS NOT NULL) AND (AGE > 30)
>>
>> vs
>>
>> WHERE (AGE > 30) AND (LastName IS NOT NULL)
>>
>>
>>
>> --
>> John W. Colby
>> www.ColbyConsulting.com
>> _______________________________________________
>> dba-SQLServer mailing list
>> dba-SQLServer at databaseadvisors.com
>> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
>> http://www.databaseadvisors.com
>>
>>
> _______________________________________________
> dba-SQLServer mailing list
> dba-SQLServer at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
> http://www.databaseadvisors.com
> 
> 



More information about the dba-SQLServer mailing list