Oracle index creation policy

Source: Internet
Author: User

Oracle index problems are often encountered when learning Oracle. Here we will introduce the solutions to Oracle index problems. Oracle indexes and corresponding tables should be in different tablespaces. Oracle can read data on different hard disks in parallel to avoid I/O conflicts. B-tree indexes: store the value of the index field and ROWID in the leaf node of Tree B. both unique and non-unique indexes are only applicable to B-tree indexes. Oracle allows composite indexes containing up to 32 Fields
Oracle index creation policy
1. import data before creating an index
2. You do not need to create an index for a small table.
3. Bitmap indexes should be created for fields with a small value range (such as gender fields)
4. Limit the number of indexes in a table
5. Set the appropriate PCTFREE value for the index
6. It is best to set the tablespace for storing indexes separately.
Create a non-unique index
1. create index emp_ename on employees (ename)
2. tablespace users
3. storage (......)
4. pctfree 0;
Create a unique index
1. create unique index emp_email on employees (email)
2. tablespace users;
Create a bitmap Index
1. create bitmap index emp_sex on employees (sex)
2. tablespace users;
Create reverse Index
1. create unique index order_retries on orders (order_num, order_date)
2. tablespace users
3. reverse;
Create a function index (the function index can be a common B-tree index or a bitmap index)
1. create index emp_substr_empno
2. on employees (substr (empno, 1, 2 ))
3. tablespace users;
The preceding section describes the Oracle index creation policy.

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.