I need to index some tables and for that i found that there are different kinds of indexing. I am kind of clueless on their proper place of usage.
Should i create index on all the fields that want to retrieve quickly or Should i create composite index on couple of fields?
Is it OK to create composite indexes along with the normal indexes? suppose i have 3 fields :
FirstName
LastName
State
Can i individually index each field and then have different composit indexes on these fields as well?
For example by writing :
Create index indx_name on tblTest(FirstName);
Create index indx_lastname on tblTest(Last name);
Create index indx_state on tblTest(state);
create index indx_cmp_fls on tblTest(FirstName,LastName,state);
create index indx_cmp_lfs on tblTest(LastName,FirstName,state);
create index indx_cmp_sfl on tblTest(state,FirstName,LastName);
create index indx_cmp_slf on tblTest(state,LastName,FirstName);
Is it OK?
Is it suggested? if not what is the best way ?
Is it also OK to have index on all fields ?
Best Answer
Your question amounts to, "How do I use indexes?" You should read some Oracle documentation to get up to speed on how to use indexes and how to determine what columns to index. Oracle has an entire library of free online books and documentation for their products. A few good links to start: