Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating index

Status
Not open for further replies.

iffoiffy

Programmer
Feb 24, 2005
67
CA
Hi,

Is it Ok two create an index on a field after enetring data ..or will it cause any problem has to be when you create a table?

Thanks
 
suppose I am creating an index on a field called "product_price". I am doing so because i want people to be able to search by price. This field will offourse have duplicate field as more tha one product can have same price. So you are saying index is only for a fields that has unique values in it? right?
 
Not at all, what you propose is perfectly feasible.

A "unique index" is a special kind of index which forces the associated column(s) to have unique values.

Just use an ordinary index on the product_price field.
 
no, i am saying that if you want to declare a unique index, you would have problems if there were duplicate values in the column already

obviously, for price you would not want a unique index, just a regular index

but we didn't know that from your first post

:)

rudy | r937.com | Ask the Expert | Premium SQL Articles
SQL for Database-Driven Web Sites (next course starts March 6 2005)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top