Skip to main content

Optimizer Transformations

  • Chapter
  • First Online:
Expert Oracle SQL
  • 1611 Accesses

Abstract

We have seen throughout this book that there are many ways to transform one SQL query (or DML subquery) into another without in any way changing the query's meaning. For all but the most trivial of queries the CBO will consider a number of such transformations, sometimes estimating costing, to determine the best SQL statement on which to perform the final state optimization that we just covered in Chapter 12. This chapter is dedicated to the topic of optimizer transformations; you will see that there are a bewildering number of such transformations. Although not all optimizer transformations are included in this chapter, the vast majority that you will encounter in your day-to-day life are, as well as some that you will rarely encounter.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    I have reason to believe that there may actually be a bug in 12.1.0.1.

  2. 2.

    Restrictions on complex view merging preclude reversing the transformation in Listing 13-17.

  3. 3.

    Occasionally an INDEX FAST FULL SCAN will not be materialized unless hinted even when referenced multiple times.

  4. 4.

    Actually Jonathan Lewis has shown me a counterexample that uses the SEMIJOIN_DRIVER hint but the CBO will never generate such a plan without such nefarious hinting.

  5. 5.

    The academic paper didn’t use the SH example schema but I have produced an equivalent example.

  6. 6.

    They are equivalent after the correction of what appears to be a typographical error.

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Tony Hasler

About this chapter

Cite this chapter

Hasler, T. (2014). Optimizer Transformations. In: Expert Oracle SQL. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4302-5978-7_13

Download citation

Publish with us

Policies and ethics