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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

basic question about "Index" 1

Status
Not open for further replies.

CCSC0208

Technical User
May 16, 2003
22
US
Hello,

This question may be very stupid. I know that using index is easier to find a record in a database. Since the primary key is unique and can not be duplicated, if the primary key is the index, why do we need other fields to be index? Is it enough that I only assign the primary key to be the index? And Access automatically chooses some fields to be index. Do that matter if I delete them or keep them there?

Thank you for any answer.
 
Some what depends on the logic of hte PK creation. If, for example, you were to assing an AutoNumber field as your primary key, using it to locate a specific record might not be all that useful - afterall, you woud need to "know" the value before the lookup. Which COULD mean searching for the record theough other means (fields). If -on the other hand- your primary key is the compound set of several fields and you suddenly need to find a group of records, the Primary Key is (sadly) not of any use as it is unique for each record and you would be searching for a group (set) of records which match some criteria. For example, suppose your PK consist of [source] and [destination] fields (I thinking shipping arrangemnents table), and you are asked to find all parties involved in a specific region. IF your table includes the addresses (with -OF COURSE- propper) Zip Codes AND you have indexed the table (seperatly of course) on THAT field, the selection can be made more quickly (You SILL need to get the popper list / range of zip codes).





MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top