What Is SQL Statement Tuning?

SQL statement tuning is the process of optimally building SQL statements to achieve results in the most effective and efficient manner. SQL tuning begins with the basic arrangement of the elements in a query. Simple formatting plays a rather large role in the optimization of a statement.

SQL statement tuning mainly involves tweaking a statement's FROM and WHERE clauses. It is in these two clauses that the database server decides how to evaluate a query. To this point, you have learned the FROM and WHERE clauses' basics. Now it is time to learn how to fine-tune them for better results and happier users.

Get Sams Teach Yourself SQL in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.