Create an index for an ORACLE data table
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)