On Tue, 27 Mar 2001, Cal Evans wrote:

> Key = Creates an index
> Index = Same as above? (Not sure, the section of the manual I just glanced
> at seems to indicate that they are the same thing)
> PRIMARY KEY = Creates a primary key for the table.  Each table should have a
> primary key and it should be unique for that row in that table. (For more on
> PK theory, checkout
> http://www1.fatbrain.com/asp/BookInfo/BookInfo.asp?theisbn=0764504150&from=T
> GD352 )
> UNIQUE = Like primary key in that it creates a unique index on that field
> but it is not considered a primary key.

Hello Cal,

First: I don't think it is necessary that each table should have a primary key.

Second: there seems to be some confusion between the concepts of primary key and 
primary index.
>From the theory (at least the one I know) a primary index is NOT an index on a 
>primary key. Primary key is just the one of all the candidate keys that was chosen by 
>the DBA. Primary index on the other hand is the index whose search key specifies the 
>sequential order of the file. 
So someone please bother to explain what happens exactly in Mysql. From what I gather, 
when you specify a field(s) as PK, you just get another secondary index on that field.
So we come to the conclusion that primary key is just another unique key with a 
special name. Therefore the concept of primary index doesn't exist in Mysql and the 
only flavor you have is secondary indexes either on unique or non-unique keys.

Are the above conclusions correct?

regards,
thalis


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to