Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Oracle > is there any performance difference between unique and no unique index

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-03-03, 08:30
tal_olier tal_olier is offline
Registered User
 
Join Date: Aug 2002
Location: IL
Posts: 73
is there any performance difference between unique and no unique index

Hi,

We are working with both databases Oracle and MS-SQL and we have an open channel to MS-SQL server core team.

We got the word from them that there is a difference between unique and no unique index from the optimizer perspective, i.e. the optimizer knowing that the index is unique may choose a more suitable plan for running a specific query, we're still trying to find a specific example.

Anyway, since we do not have an open channel to Oracle core, I thought maybe one of you guys knows something about Oracle optimizer behavior on this issue.

I am interested verified answers from certified sources and not suggestions or thoughts.

Thanks in advanced,


Tal (otal@mercury.co.il).
Reply With Quote
  #2 (permalink)  
Old 07-03-03, 09:07
blom0344 blom0344 is offline
Registered User
 
Join Date: Jan 2003
Location: Zutphen,Netherlands
Posts: 256
" verified answers from certified sources "

" not suggestions or thoughts. "

Why post this in an open forum anyway then?
I will give you my thoughts anyway (for what is is worth)

Column contents will decide whether you can define a unique index, ultimately the SQL conditions will determine what is most effective.
Accessing the greater part of a table can be even faster by doing a full table scan. There is no ultimate theory or truth here, just going for performance testing / using explain plan to get as much insight as possible...
__________________
Ties Blom
Senior Application Developer BI
Getronics Healthcare
DB2,ORACLE,Powercenter,BusObj,Access,
SQL, SQL server
Reply With Quote
  #3 (permalink)  
Old 07-03-03, 09:32
tal_olier tal_olier is offline
Registered User
 
Join Date: Aug 2002
Location: IL
Posts: 73
Quote:
Originally posted by blom0344
" verified answers from certified sources "

" not suggestions or thoughts. "

Why post this in an open forum anyway then?
I will give you my thoughts anyway (for what is is worth)

Column contents will decide whether you can define a unique index, ultimately the SQL conditions will determine what is most effective.
Accessing the greater part of a table can be even faster by doing a full table scan. There is no ultimate theory or truth here, just going for performance testing / using explain plan to get as much insight as possible...



Did not meant to offend.

Thanks.

Tal.
Reply With Quote
  #4 (permalink)  
Old 07-03-03, 11:32
bstjean bstjean is offline
Registered User
 
Join Date: Sep 2002
Location: Montreal, Canada
Posts: 219
Re: is there any performance difference between unique and no unique index

Quote:
Originally posted by tal_olier
Hi,

We are working with both databases Oracle and MS-SQL and we have an open channel to MS-SQL server core team.

We got the word from them that there is a difference between unique and no unique index from the optimizer perspective, i.e. the optimizer knowing that the index is unique may choose a more suitable plan for running a specific query, we're still trying to find a specific example.
Tal (otal@mercury.co.il).


Yes because a unique index has a better selectivity and since selectivity is one of the things the optimizer looks at... But there's more that that. You can't say for sure that it's always better... Depends on a lot of things... For instance, if your table has 2 rows, neither of these 2 indexes will be used since a table scan will be way more faster. But in 99.99% of the cases, a unique index is better than a "not unique" one.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On