Oracle Composite B*TREE Index Branch contains non-pilot column key values within the block?

Source: Internet
Author: User
Tags create index

Long time do not touch the database of the bottom details of things, a few days ago, a little guy came to me, not to say compound B*tree Index branch block contains only the pilot column key information, does not contain non-pilot column key value information, but also dump the branch block, to prove his statement, From common sense and SQL statement execution information can be known that his statement is problematic, but how to prove it? In order to prove this, also trouble once, play for years do not touch dump. Here are the two dump results (one for single-key indexes and the other for composite indexes) that he proves his point of view:

The following is my test process and results:

CREATE TABLE T1 (C1 int,c2 int,c3 int,c4 char (+), C5 char (2000));

CREATE index t1_idx1 on T1 (C1,C2,C3,C4,C5);

Begin

For I in 1..1000 loop
INSERT into T1 values (0,0,i, ' AA ', ' AA ');
End Loop;
End
/

Begin
For I in 1001..2000 loop
INSERT into T1 values (0,i,i, ' BB ', ' BB ');
End Loop;
End
/

Select segment_name,file_id,block_id
From Dba_extents
where Segment_name= ' t1_idx1 '
and extent_id=0;


Alter system dump DATAFILE 4 block 195;

TRC file content:

Thus, the composite B*tree Index branch block, sometimes does not contain non-pilot column key values, but sometimes contains. So, under what circumstances does it include, and under what circumstances? The experimental result is that when the selection of the Pilot column key is good enough, it is not necessary to include the key value of the non-pilot column, otherwise, it is also a waste of Branck block valuable space; only if the key value of the pilot column is not selective enough, the key value of the non-pilot column must be combined to locate the next block. To include non-pilot column of the key value, the test process omitted here, interested students can follow this idea to test themselves.

Oracle Composite B*TREE Index Branch contains non-pilot column key values within the block?

Related Article

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.