Brief Introduction to Oracle driver table

Source: Internet
Author: User

Oracle has a lot to learn about. Here we mainly introduce the Oracle driver table, including the usage of hints. CBO selects the Oracle driver table based on the statistical information. If no statistical information is available, select the Oracle driver table from left to right in the from clause. This is in the opposite order of RBO selection. This is the original English version (CBO determines join order from costs derived from gathered statistics. if there are no stats then CBO chooses the driving order of tables from LEFT to RIGHT in the FROM clause. this is OPPOSITE to the RBO ).

I still cannot confirm the correctness of this sentence. However, after verification, the statement "if ordered is used (CBO must be used at this time), select the Oracle driver table from left to right in the from clause" is correct. In fact, in CBO, if there is statistical data (that is, the table and index are analyzed), the optimizer will automatically decide which connection type to use based on the cost value, and select the appropriate Oracle driver table, this has nothing to do with the locations of each restriction condition in the where clause. If we want to change the connection type or Oracle driver table selected by the optimizer, we need to use hints. The usage of hints will be introduced later.

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 
  1. Oracle document Learning Experience
  2. How to Understand the execution plan generated by Oracle
  3. Oracle table join
  4. Analysis of four categories of Oracle index Scanning
  5. Master talk about Oracle index Scanning

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.