10.1 Query Processing and Query Optimization

In Chapter 5, we saw that some SQL queries can be expressed in different ways. For example, in a SELECT statement involving two or more tables, we can sometimes choose between a join and a subquery. Similarly, in Chapter 4, we considered that different sequences of relational algebra commands that produce equivalent results. We noted in passing certain formulations of these queries are more efficient than others. For example, it is more efficient to perform a natural join instead of a Cartesian product followed by a selection. In this chapter, we examine relative efficiency and discuss some techniques for improving the efficiency of queries.

When a database management system (DBMS) receives a high-level ...

Get Databases Illuminated, 4th 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.