Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

single column index vs composite index?

unknown-879931Nov 30 2013 — edited Dec 1 2013

I am just wondering that what are the differences between the following?

create table test(

person_id number

name varchar2(50),

surname varchar2(50)

);

create index my_indx on test(name);

create index my_indx2 on test(surname);

OR

create index my_indx3 on test(name, surname);

OR

create index my_indx4 on test(surname, name);

What are the differences among these three indexes?

When I create name and surname columns in same index (composite index) in order to index scan should I use both of them in the where clause?  

My last question is, Is the order important for composite indexes?

Thanks in advance.

This post has been answered by Nikolay Savvinov on Dec 1 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 29 2013
Added on Nov 30 2013
6 comments
1,824 views