SlideShare a Scribd company logo
1 of 8
Index
What is Index
 Indexes are optional structures associated with
tables and clusters that allow SQL statements to
execute more quickly against a table. Just as the
index in this manual helps you locate information
faster than if there were no index, an Oracle
Database index provides a faster access path to table
data. You can use indexes without rewriting any
queries. Your results are the same, but you see them
more quickly.
An index is a performance-tuning method
of allowing faster retrieval of records. An
index creates an entry for each value that
appears in the indexed columns. By
default, Oracle creates B-tree indexes
 Indexes are logically and physically independent of
the data in the associated table. Being independent
structures, they require storage space. You can create
or drop an index without affecting the base tables,
database applications, or other indexes. The
database automatically maintains indexes when you
insert, update, and delete rows of the associated
table. If you drop an index, all applications continue
to work. However, access to previously indexed data
might be slower.
Create an Index
 CREATE [UNIQUE] INDEX index_name
ON table_name (column1[, column2, . column_n])
[ COMPUTE STATISTICS ];
 UNIQUE indicates that the combination of values in the indexed
columns must be unique.
 COMPUTE STATISTICS tells Oracle to collect statistics during the
creation of the index. The statistics are then used by the optimizer to
choose a "plan of execution" when SQL statements are executed.
 create an index on the supplier table called supplier_idx. It consists of only one field - the supplier_name field
 CREATE INDEX supplier_idx
ON supplier (supplier_name);
 create an index with more than one field
 CREATE INDEX supplier_idx
ON supplier (supplier_name, city);
 Create unique index with one field
 CREATE UNIQUE INDEX supplier_u_idx
ON supplier (supplier_name);
 Create unique index with more than one field
 CREATE UNIQUE INDEX supplier_u_idx
ON supplier (supplier_name, city);
Rename an Index
 ALTER INDEX index_name
RENAME TO new_index_name;
 ALTER INDEX supplier_idx
RENAME TO supplier_index_name;
Drop an Index
 DROP INDEX index_name;
 DROP INDEX supplier_idx;
More on Indexes (user_indexes,
user_ind_columns)
 To see all indexes made on a table
SELECT index_name , index_type, table_name FROM
user_indexes WHERE table_name=‘MY_TABLE’;
 To see columns on which indexes have been made
SELECT index_name, table_name, column_name
FROM user_ind_columns WHERE
table_name=‘MY_TABLE’;

More Related Content

What's hot

İleri Seviye T-SQL Programlama - Chapter 07
İleri Seviye T-SQL Programlama - Chapter 07İleri Seviye T-SQL Programlama - Chapter 07
İleri Seviye T-SQL Programlama - Chapter 07Cihan Özhan
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)Ishucs
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In SqlAnurag
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)Sabana Maharjan
 
Database Indexes
Database IndexesDatabase Indexes
Database IndexesSperasoft
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functionsfarwa waqar
 
İleri Seviye T-SQL Programlama - Chapter 04
İleri Seviye T-SQL Programlama - Chapter 04İleri Seviye T-SQL Programlama - Chapter 04
İleri Seviye T-SQL Programlama - Chapter 04Cihan Özhan
 
İleri Seviye T-SQL Programlama - Chapter 06
İleri Seviye T-SQL Programlama - Chapter 06İleri Seviye T-SQL Programlama - Chapter 06
İleri Seviye T-SQL Programlama - Chapter 06Cihan Özhan
 
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningIndexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningOSSCube
 

What's hot (20)

Subqueries
SubqueriesSubqueries
Subqueries
 
View & index in SQL
View & index in SQLView & index in SQL
View & index in SQL
 
Introduction to sql
Introduction to sqlIntroduction to sql
Introduction to sql
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
İleri Seviye T-SQL Programlama - Chapter 07
İleri Seviye T-SQL Programlama - Chapter 07İleri Seviye T-SQL Programlama - Chapter 07
İleri Seviye T-SQL Programlama - Chapter 07
 
Sql(structured query language)
Sql(structured query language)Sql(structured query language)
Sql(structured query language)
 
Constraints In Sql
Constraints In SqlConstraints In Sql
Constraints In Sql
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
 
Introduction to structured query language (sql)
Introduction to structured query language (sql)Introduction to structured query language (sql)
Introduction to structured query language (sql)
 
Basic sql Commands
Basic sql CommandsBasic sql Commands
Basic sql Commands
 
BCNF
BCNFBCNF
BCNF
 
Database Indexes
Database IndexesDatabase Indexes
Database Indexes
 
introdution to SQL and SQL functions
introdution to SQL and SQL functionsintrodution to SQL and SQL functions
introdution to SQL and SQL functions
 
SQL Overview
SQL OverviewSQL Overview
SQL Overview
 
İleri Seviye T-SQL Programlama - Chapter 04
İleri Seviye T-SQL Programlama - Chapter 04İleri Seviye T-SQL Programlama - Chapter 04
İleri Seviye T-SQL Programlama - Chapter 04
 
İleri Seviye T-SQL Programlama - Chapter 06
İleri Seviye T-SQL Programlama - Chapter 06İleri Seviye T-SQL Programlama - Chapter 06
İleri Seviye T-SQL Programlama - Chapter 06
 
Sql commands
Sql commandsSql commands
Sql commands
 
SQL commands
SQL commandsSQL commands
SQL commands
 
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningIndexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuning
 
Sequences and indexes
Sequences and indexesSequences and indexes
Sequences and indexes
 

Similar to Oracle Index

Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6Ala Qunaibi
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management Systemsweetysweety8
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)Ehtisham Ali
 
Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008wharrislv
 
Database index
Database indexDatabase index
Database indexRiteshkiit
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuningAnil Pandey
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 Andriy Krayniy
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005rainynovember12
 
Database Performance
Database PerformanceDatabase Performance
Database PerformanceBoris Hristov
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Aaron Shilo
 
Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexespaulguerin
 

Similar to Oracle Index (20)

Module08
Module08Module08
Module08
 
Module08
Module08Module08
Module08
 
Sql server lesson6
Sql server lesson6Sql server lesson6
Sql server lesson6
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
 
Sql index
Sql indexSql index
Sql index
 
Index in sql server
Index in sql serverIndex in sql server
Index in sql server
 
Les12
Les12Les12
Les12
 
Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008Filtered Indexes In Sql 2008
Filtered Indexes In Sql 2008
 
SQL Commands
SQL Commands SQL Commands
SQL Commands
 
Database index
Database indexDatabase index
Database index
 
Application sql issues_and_tuning
Application sql issues_and_tuningApplication sql issues_and_tuning
Application sql issues_and_tuning
 
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1 "Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
"Using Indexes in SQL Server 2008" by Alexander Korotkiy, part 1
 
Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005Optimizing Data Accessin Sq Lserver2005
Optimizing Data Accessin Sq Lserver2005
 
Database Performance
Database PerformanceDatabase Performance
Database Performance
 
V25 sql index
V25 sql indexV25 sql index
V25 sql index
 
Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…Getting to know oracle database objects iot, mviews, clusters and more…
Getting to know oracle database objects iot, mviews, clusters and more…
 
Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexes
 
Physical Design and Development
Physical Design and DevelopmentPhysical Design and Development
Physical Design and Development
 
Chapter.07
Chapter.07Chapter.07
Chapter.07
 

More from Madhavendra Dutt (12)

Introduction to oracle
Introduction to oracleIntroduction to oracle
Introduction to oracle
 
Communication
CommunicationCommunication
Communication
 
Sticky bit suid sgid
Sticky bit suid sgidSticky bit suid sgid
Sticky bit suid sgid
 
Linux intermediate level
Linux intermediate levelLinux intermediate level
Linux intermediate level
 
Linux begining level
Linux begining levelLinux begining level
Linux begining level
 
Io vb.net
Io vb.netIo vb.net
Io vb.net
 
Vb.net
Vb.netVb.net
Vb.net
 
Java interview questions and answers
Java interview questions and answersJava interview questions and answers
Java interview questions and answers
 
Oracle view
Oracle viewOracle view
Oracle view
 
Oracle sql ppt2
Oracle sql ppt2Oracle sql ppt2
Oracle sql ppt2
 
Oracle sql ppt1
Oracle sql ppt1Oracle sql ppt1
Oracle sql ppt1
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 

Recently uploaded

Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubaihf8803863
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改atducpo
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxEmmanuel Dauda
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDRafezzaman
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...Florian Roscheck
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdfHuman37
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...dajasot375
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFAAndrei Kaleshka
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...Suhani Kapoor
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAbdelrhman abooda
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfSocial Samosa
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingNeil Barnes
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一fhwihughh
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationshipsccctableauusergroup
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Sapana Sha
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样vhwb25kk
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...ThinkInnovation
 

Recently uploaded (20)

Dubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls DubaiDubai Call Girls Wifey O52&786472 Call Girls Dubai
Dubai Call Girls Wifey O52&786472 Call Girls Dubai
 
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
代办国外大学文凭《原版美国UCLA文凭证书》加州大学洛杉矶分校毕业证制作成绩单修改
 
Customer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptxCustomer Service Analytics - Make Sense of All Your Data.pptx
Customer Service Analytics - Make Sense of All Your Data.pptx
 
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
VIP Call Girls Service Charbagh { Lucknow Call Girls Service 9548273370 } Boo...
 
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTDINTERNSHIP ON PURBASHA COMPOSITE TEX LTD
INTERNSHIP ON PURBASHA COMPOSITE TEX LTD
 
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...From idea to production in a day – Leveraging Azure ML and Streamlit to build...
From idea to production in a day – Leveraging Azure ML and Streamlit to build...
 
20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf20240419 - Measurecamp Amsterdam - SAM.pdf
20240419 - Measurecamp Amsterdam - SAM.pdf
 
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
Indian Call Girls in Abu Dhabi O5286O24O8 Call Girls in Abu Dhabi By Independ...
 
How we prevented account sharing with MFA
How we prevented account sharing with MFAHow we prevented account sharing with MFA
How we prevented account sharing with MFA
 
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
 
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptxAmazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
Amazon TQM (2) Amazon TQM (2)Amazon TQM (2).pptx
 
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdfKantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
Kantar AI Summit- Under Embargo till Wednesday, 24th April 2024, 4 PM, IST.pdf
 
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data StorytellingBrighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
 
Call Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort ServiceCall Girls in Saket 99530🔝 56974 Escort Service
Call Girls in Saket 99530🔝 56974 Escort Service
 
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
办理学位证纽约大学毕业证(NYU毕业证书)原版一比一
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
 
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
Saket, (-DELHI )+91-9654467111-(=)CHEAP Call Girls in Escorts Service Saket C...
 
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
1:1定制(UQ毕业证)昆士兰大学毕业证成绩单修改留信学历认证原版一模一样
 
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
Predictive Analysis - Using Insight-informed Data to Determine Factors Drivin...
 

Oracle Index

  • 2. What is Index  Indexes are optional structures associated with tables and clusters that allow SQL statements to execute more quickly against a table. Just as the index in this manual helps you locate information faster than if there were no index, an Oracle Database index provides a faster access path to table data. You can use indexes without rewriting any queries. Your results are the same, but you see them more quickly. An index is a performance-tuning method of allowing faster retrieval of records. An index creates an entry for each value that appears in the indexed columns. By default, Oracle creates B-tree indexes
  • 3.  Indexes are logically and physically independent of the data in the associated table. Being independent structures, they require storage space. You can create or drop an index without affecting the base tables, database applications, or other indexes. The database automatically maintains indexes when you insert, update, and delete rows of the associated table. If you drop an index, all applications continue to work. However, access to previously indexed data might be slower.
  • 4. Create an Index  CREATE [UNIQUE] INDEX index_name ON table_name (column1[, column2, . column_n]) [ COMPUTE STATISTICS ];  UNIQUE indicates that the combination of values in the indexed columns must be unique.  COMPUTE STATISTICS tells Oracle to collect statistics during the creation of the index. The statistics are then used by the optimizer to choose a "plan of execution" when SQL statements are executed.
  • 5.  create an index on the supplier table called supplier_idx. It consists of only one field - the supplier_name field  CREATE INDEX supplier_idx ON supplier (supplier_name);  create an index with more than one field  CREATE INDEX supplier_idx ON supplier (supplier_name, city);  Create unique index with one field  CREATE UNIQUE INDEX supplier_u_idx ON supplier (supplier_name);  Create unique index with more than one field  CREATE UNIQUE INDEX supplier_u_idx ON supplier (supplier_name, city);
  • 6. Rename an Index  ALTER INDEX index_name RENAME TO new_index_name;  ALTER INDEX supplier_idx RENAME TO supplier_index_name;
  • 7. Drop an Index  DROP INDEX index_name;  DROP INDEX supplier_idx;
  • 8. More on Indexes (user_indexes, user_ind_columns)  To see all indexes made on a table SELECT index_name , index_type, table_name FROM user_indexes WHERE table_name=‘MY_TABLE’;  To see columns on which indexes have been made SELECT index_name, table_name, column_name FROM user_ind_columns WHERE table_name=‘MY_TABLE’;

Editor's Notes

  1. http://docs.oracle.com/cd/B19306_01/server.102/b14231/indexes.htm
  2. http://www.techonthenet.com/oracle/indexes.php