Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

Add index to table

I have a table with a primary key.
How would I add an index to an additional column?
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

you create another index, normally on just that column.

what is the exact issue you have?
Avatar of malikirfan28
malikirfan28

There are normally two types of indexes - Clustered and non-Clustered. Primary keys normally create clustered index. So which type of index do you want to create on another column?

If you want to create nonclustered index then you can simply use

CREATE INDEX INDEX_NAME
on TABLENAME (COLUMN NAME)
Avatar of Larry Brister

ASKER

angelIII:

I have a table that stores our media "mail history" ...actual addresses for bulk mail

the mailID is the primary key

Ive been asked to add an index on AddrID column
So if your table is called MailHistory you would use

CREATE INDEX idxAddrID
on MailHistory (AddrID)
malikirfan28: was first and Neilsr: was precise

Any problems with a 350/150 split?
ASKER CERTIFIED SOLUTION
Avatar of malikirfan28
malikirfan28

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey you can create a non cluster index on other than primary key. Same as cluster index

Create index Indexname on Table (Columnname)
malikirfan28
You have a  valid point