Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Jul 14, 1999

SQL Query Optimizing Tips

Question:
I just wanted to know if you could share some techniques on how to optimize SQL queries (for example, inner join first before performing some steps, do not use computations, etc.).

Answer:
Since this borders on a black art, the only advice I can offer is this: depending on how you are running these, use ODBC trace to trace the output of the query and, if you can, use showplan to see how the optimizer handles your request, and go from there.

There may be a zillion ways to improve performance, from creating an index to dropping one, or from changing datatypes. How about floats for auto-incrementing primary keys? (Just Kidding!)

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date