×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

indexes and keys

indexes and keys

indexes and keys

(OP)
Definitions please:
What is the difference between a composite index, composite key, vs primary + secondary index.  
Is creating a composite key as simple as defining 2 fields as keys?  I haven't seen any good how-to references on this.
 

RE: indexes and keys

Quote:


Definitions please:
What is the difference between a composite index, composite key, vs primary + secondary index.  
Is creating a composite key as simple as defining 2 fields as keys?  I haven't seen any good how-to references on this.

Composite key consists of the FIRST n fields of a TABLE.

Composite index consists of the FIRST n fields of a SECONDARY INDEX (although technically they could also be the first n fields of the table).

Primary index would be the first n fields of a table.

Secondary indexes are defined on the Indexes tabs of a table structure dialog (or in code, of course).  2ndary index fields do NOT have to be the first fields in the table, nor do they need to be contiguous (next to each other) in the table.

Composite key?  Yes, but the fields must be next to each other in the table (you said key, not index).  Most recommend against it if possible; use a meaningless integer system instead (NOT an AutoIncrement field! - roll your own or borrow one of those found easily on the various other newsgroups out there (pnews, for instance)).

Tony McGuire
Stop Rob Bennett - http://www.notrob.info
"It's not about having enough time; we have the rest of our lives.  It's about priorities."

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close