Create an index for an oracle data table

Source: Internet
Author: User
Welcome to the Oracle community forum and interact with 2 million technical staff. According to the general saying, if the data volume of a data table exceeds several hundred entries, you should consider creating an index. After so long, we finally created an index for some of our larger data tables. First, check the existing index selectindex_namefromall.

Welcome to the Oracle community forum and interact with 2 million technical staff> according to the general saying, if a data table contains more than several hundred data records, you should consider creating an index. After so long, we finally created an index for some of our larger data tables. First, check the currently created index select index_name from all

Welcome to the Oracle community forum and interact with 2 million technical staff> enter

In general, if the data volume of a data table exceeds several hundred entries, you should consider creating an index. After so long, we finally created an index for some of our larger data tables.

First, check the existing indexes.

Select index_name from all_indexes where table_name = 'picture ';

Sure enough, the system only built the index for the primary key: SYS_C55001

An error is also made. In general, oracle is case-insensitive, but table_name in the preceding query statement must be in uppercase. If it is written as 'picture ', there is no record.

Then, create an index.

Create index picture_album_idx on picture (aid );

Create index picture_user_idx on picture (userid );

Create index picture_cat_idx on picture (cid );

Third, repeat the first step to verify whether the operation is successful.

Fourth, let's see if the speed is faster when you browse the album.

In theory, it should be faster.

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

Eg:

Select index_name from all_indexes where table_name = 'tb _ PUT_APPROVE ';

Select * from TB_PUT_APPROVE t

Create index TB_PUT_APPROVE_approveid on TB_PUT_APPROVE (approveid)

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.