In SQL server you can write
create index indx on T1 (A,B) INCLUDE (C,D,E)
Is there a way to do the same thing in Oracle?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Simply put all the columns in the index:
create index indx on T1 (A,B,C,D,E)If Oracle decides to use your index (e.g., A and B are in the WHERE clause) it will take the values of C, D, and E from the index.
If the columns are very long varchars Oracle may not be able to build the index. This is sometimes called a “covered” index and I’ve used or seen it on more than a few occasions.