Chapter 10. Joins and Subqueries

In this chapter, we discuss ways to improve performance when two or more tables are joined. Most nontrivial SQL statements contain joins, and ensuring that the tables involved are joined in the most effective manner is an important factor when tuning SQL.

The Oracle optimizer will do its best to ensure that the types of joins and the order in which tables are joined is optimal. Sometimes, the optimizer will be unable to determine the best join plan because of limitations in its algorithms and its understanding of your data. It is then up to you to enforce the optimal join approach through hints or other means.

Subqueries are close relatives to joins. Subqueries allow a SQL query to be embedded in another SQL ...

Get Oracle 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.