Chapter 21. Advanced SQL Tuning
In the last chapter, we emphasized that high-performance stored programs require optimized SQL statements. We then reviewed the basic elements of SQL tuning — namely, how to optimize single-table accesses and simple joins. These operations form the building blocks for more complex SQL operations.
In this chapter, we will look at optimizing such SQL operations as:
Subqueries using the
IN
andEXISTS
operators“Anti-joins” using
NOT IN
orNOT EXISTS
“Unamed” views in
FROM
clausesNamed or permanent views
DML statements (
INSERT
,UPDATE
, andDELETE
)
Get MySQL Stored Procedure Programming 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.