View Single Post

  #8 (permalink)  
Old 10-24-2005
Tony Marston
 
Posts: n/a
Default Re: Need to understand INDEX and PKEYS


"Axel Schwenke" <axel.schwenke@gmx.de> wrote in message
news:ur2hjd.edh.ln@idefix.xl.local...
> Christian Kirsch <ck@bru6.de> wrote:
>> Tony Marston wrote:
>>
>>> An index is a non-unique key.

>
> A key is always unique.
> There is no such thing as a nonunique key.


A non-unique key is known as an index. It provides fast access, or a "key",
into a table without requiring a full table scan.

>> That makes me wonder why CREATE INDEX has the optional UNIQUE keyword...

>
> Because it's the other way round: A KEY is an UNIQUE index.
> Indexes can be either unique or nonunique. If an index is
> unique, it's sometimes[1] called a key.
>
> [1] "key" is a theoretical construct, "index" a practical one


Keys cannot be theoretical because they actually exist. Life on Mars is
theoretical.

--
Tony Marston

http://www.tonymarston.net



Reply With Quote