Skip to Main Content

SQL & PL/SQL

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!

Should you index the columns in your Select list or Where clause?

stuartmMay 4 2018 — edited May 8 2018

Am learning about indexing from the docs but am a bit confused on this point. My assumption up to now was that your predicates are the bit of your query that determine whether and which indexes are used. It's this part of the query that restricts which rows are located/fetched so it makes sense that indexes will help with this.

In the Developers Guide doc I came across a recommendation however that (paraphrasing) indexes should be added to columns that you query frequently. My interpretation of 'query' here is 'select', I may be wrong here however.

In that context then it suggests the columns you're Selecting will drive whether an index is used, rather than the columns in your where clause, I think?

Can anyone clarify please?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2018
Added on May 4 2018
13 comments
6,310 views