Oracle document Learning Experience

Source: Internet
Author: User

There are many things worth learning about in Oracle. Here we will mainly introduce the Oracle documentation, including the RBO optimizer. In the Oracle document, for RBO, select the driver table from right to left in the from clause, that is, the rightmost table is the first driver table: all things being equal RBO chooses the driving order by taking the tables in the FROM clause RIGHT to LEFT.

However, in my tests, I have never verified that this statement is correct. In my opinion, even in RBO, there is also a set of rules to decide which connection type and which table to use as the driving table. In the selection, the current index will definitely be taken into account, the restriction condition in the where clause may also be considered, but it must be irrelevant to the location of the restriction condition in the where clause.

If I create three tables:

 
  1. create table A(col1 number(4,0),col2 number(4,0), col4 char(30));  
  2. create table B(col1 number(4,0),col3 number(4,0), name_b char(30));  
  3. create table C(col2 number(4,0),col3 number(4,0), name_c char(30));  
  4. create index inx_col12A on a(col1,col2); 

Run the query:

 
  1. select A.col4  
  2. from B, A, C  
  3. where B.col3 = 10 
  4. and A.col1 = B.col1  
  5. and A.col2 = C.col2  
  6. and C.col3 = 5;  
  7. Execution Plan 

Using the above examples, I am skeptical about the "All things being equal RBO chooses the driving order by taking the tables in the FROM clause RIGHT to LEFT" statement in the Oracle document. At this point, I cannot use hints to force the optimizer to use the nested loop. If hints is used, the CBO optimizer is automatically used instead of the RBO optimizer.

  1. How to Understand the execution plan generated by Oracle
  2. Oracle table join
  3. Analysis of four categories of Oracle index Scanning
  4. Master talk about Oracle index Scanning
  5. Quick introduction to Oracle hash connections

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.