devxlogo

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

Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.

See also  Five Early Architecture Decisions That Quietly Get Expensive

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.