If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > What is the best order of columns in an index?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-22-03, 18:25
Byteboy Byteboy is offline
Registered User
 
Join Date: Jul 2003
Posts: 1
What is the best order of columns in an index?

I have a question for the experts, when putting an index on an ASA 8.0.2 database do you put the most unique field first or least unique.
For example say you have 3 columns....... location(least unique),style,UPC(most unique).
Would your index be location,style,upc
or
upc,style,location ?

Thanks,
Byte
Reply With Quote
  #2 (permalink)  
Old 07-24-03, 06:37
fadace fadace is offline
Registered User
 
Join Date: Nov 2002
Location: Switzerland
Posts: 523
Yes, it's more powerfull when your're using a SARG in the 3 fields. But a problem exists : if you only know the localisation and the style, the index won't be used...
Reply With Quote
  #3 (permalink)  
Old 07-24-03, 11:47
vr8ce vr8ce is offline
Registered User
 
Join Date: Jul 2003
Posts: 10
Most unique first, absolutely. I've been burned in the distant past by trying it the other way.
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

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