multi-part index and when it is used?
Say I have a phonebook table that has a multi-part index on lastname, firstname, middleInitial. If I do SELECT * FROM phonebook WHERE lastName = 'Smith', then it should use the index right? What if I do SELECT * FROM phonebook WHERE lastName LIKE 'S%' would that use the index also? If I wanted to list the whole phonebook would SELECT * FROM phonebook use the correct index if I had multiple indexes?
THe idea behind this is I heard that trying to remove ORDER BY by using indexes helps on RAM and can speed a query up potentially. Therefore, I was thinking of how to do this in scenarios like the the one give where there are some WHEREs, but not all.
Peter
Subject
Views
Written By
Posted
multi-part index and when it is used?
4933
January 12, 2005 05:05PM
2834
January 12, 2005 09:21PM
2090
January 13, 2005 07:18AM
2217
January 13, 2005 07:36AM
2032
January 13, 2005 07:39AM
2088
January 14, 2005 01:29AM
2257
January 14, 2005 10:03AM
2145
January 14, 2005 04:05PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.