What is the difference between an Oracle B*tree index and an Oracle bitmap index

Source: Internet
Author: User
Tags create index

(1) Establish B*tree index

3:11:08 sql>create index Emp1_job_ind on EMP1 (Job);

(2) Analysis of index structure

3:11:08 sql> ANALYZE INDEX emp1_job_ind VALIDATE STRUCTURE;

Index analyzed.

(3) View Index storage information

03:11:41 sql> SELECT blevel,leaf_blocks,num_rows from user_indexes

03:12:12 2 WHERE index_name= ' Emp1_job_ind ';

Blevel Leaf_blocks Num_rows

---------- ----------- ----------

0 1 14

03:12:26 sql> INSERT into the EMP1 SELECT * from EMP1;

---------self replication to create multiple lines of records.

03:12:26 sql> ANALYZE TABLE EMP1 COMPUTE STATISTICS;

Table analyzed.

03:13:01 sql> SELECT blevel,leaf_blocks,num_rows from user_indexes

03:13:07 2 WHERE index_name= ' Emp1_job_ind ';

Blevel Leaf_blocks Num_rows

---------- ----------- ----------

1 118 28672

(4) Establish bitmap index

03:34:52 sql> DROP Index emp1_job_ind;

03:34:52 sql> Create bitmap index emp1_job on emp1 (Job);

(5) Analysis of index structure

03:34:52 sql> ANALYZE TABLE EMP1 COMPUTE STATISTICS;

Table analyzed.

03:13:01 sql> SELECT blevel,leaf_blocks,num_rows from user_indexes

03:13:07 2 WHERE index_name= ' Emp1_job_ind ';

Blevel Leaf_blocks Num_rows

---------- ----------- ----------

1 16 10

Establishing a bitmap index on a column with a lot of duplicate values is more advantageous than the B*tree index.

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/

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.