Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL where sequence

Status
Not open for further replies.

rib742

Programmer
Jun 7, 2003
28
US
I'm in the process of switching over to building pass thorough SQL queries in Access to run reports faster and wanted to know if the sequence of "where" makes a difference in the performance. For instance, if I change the sequence of the search criteria, will this possibly make the query run any faster?

 
oops, my bad, i stupidly overlooked the fact that you posted in the sql server forum, so it's safe to assume you're passing through to sql server

no, the sql server optimizer will figure out the fastest path, no matter what order you specify the WHERE conditions in
 
Thanks r937!

Just wanted to make sure before I go converting a lot of big queries.
 
However SQL will try to make use of any indexes that you have set up in order to optimize the query so it's a good idea to create some useful indexes especially if the queries examine a lot of data and/or are run frequently.

SQL Query Analyzer will analyze your query and draw you a picture of its execution plan. This can reveal bottlenecks in queries.


Bob Boffin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top