Indexing advice [message #648274] |
Fri, 19 February 2016 10:09 |
|
geordibbk
Messages: 11 Registered: August 2015 Location: London
|
Junior Member |
|
|
I was wondering what is the recommended advice for indexing on tables.
For example Table1 has 3 columns
1) Age integer
2) Name varchar2
3) DOB date
If I add a unique index for the 3 columns:
Unique Index: Age, Name, DOB
If searching by name is often done, is it recommended to an index to Name column also?
Index: Name
Or does the unique index already optimise this?
|
|
|
|
|
Re: Indexing advice [message #648281 is a reply to message #648274] |
Fri, 19 February 2016 11:07 |
John Watson
Messages: 8931 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
In this case, I would create the table as an IOT. To determine the optimal column ordering, you need to think about your predicates, and whether you want to make use of skip scan access.
|
|
|
Re: Indexing advice [message #648355 is a reply to message #648280] |
Mon, 22 February 2016 02:59 |
cookiemonster
Messages: 13920 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
BlackSwan wrote on Fri, 19 February 2016 17:07
UNIQUE INDEX should be on NAME & DOB
While it's highly unlikely to get two people with the same name and DOB it's certainly possible. The table as it stands doesn't have anything you can apply a unique index to.
|
|
|
|
|