Oracle Indexing Learning

Source: Internet
Author: User

To view the execution status:

Select the code to press F5 directly, or click Tools===>>explain Plan

I. Considerations for indexing:

Indexes are useful when any single query retrieves less than or equal to 10% of the total number of rows in the table. This means that the candidate column for the index should be a column that stores a large range of values.

A good index candidate is a column that contains only a single number for each record; The poor index candidates are those columns that contain only a small range of numeric codes.

Second, create an index

Create [Unique] IndexIndex_name onTABLE_NAME (colum_name[, Colum_name ...]) tablespace table_space;--unique The value of the specified index column must be unique--index_name specifying the index name--table_name specifies which table to create an index on--column_name specifies which column to create an index on. We can create indexes on multiple columns, which are called conforming indexes--table_space Specifies the table space where the index is stored. If no tablespace is provided, then the index is stored in the user's default tablespace

Attention:

For performance reasons, you should typically store indexes and tables in different table spaces

Third, modify the index

Alter Index  to index_name_new -- index_name the original index name -- index_name_new the new index name

Iv. Deleting an index

Drop Index index_name -- index_name The name of the index

Oracle Indexing Learning

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.