[dba-SQLServer] SQL Server WHERE Clause order

Arthur Fuller fuller.artful at gmail.com
Mon May 5 08:32:28 CDT 2008


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
>
>



More information about the dba-SQLServer mailing list