Simple question [message #120269] |
Wed, 18 May 2005 11:58 |
kapil2005
Messages: 44 Registered: March 2005
|
Member |
|
|
I am working on a project here and I am seeing a table with a primary key index and a unique index on same set of columns, is it a good practice? For me it’s not making any sense. Do you guy know why a table can have both primary and unique key indexes on same set of columns?
Thanks
|
|
|
Re: Simple question [message #120272 is a reply to message #120269] |
Wed, 18 May 2005 12:18 |
smartin
Messages: 1803 Registered: March 2005 Location: Jacksonville, Florida
|
Senior Member |
|
|
Are the columns in the two indexes in different orders?
Queries "prefer it" when the leading column(s) in the index are used in the query criteria. So if your system has different queries, some which reference one column only and some which reference another column only, then the multiple indexes may have been created with these differing queries in mind.
If this is an associative table, you may want to consider making it an index organized table.
|
|
|
|
|