List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:July 31 2000 3:11am
Subject:RE: The meaning of "UNIQUE idx_user_id (user_id)"
View as plain text  
At 6:06 PM -0700 2000-07-30, henrydesiato@stripped wrote:
>   -----Original Message-----
>   >   -----Original Message-----
>   >
>   >   Hi,
>   >
>   >   "Actually, I can't. Do you mean that index_name is a separate column
>or
>   >        just an alias for index_col_name? The manual does have a line for
>the
>   >synta
>   >   x
>   >        of UNIQUE but it never explains it!"
>   >
>   >   Well all it means is that you can specify a name for the index. It's
>   >   optional because in itself it doesn't do anything. Really it's for
>your
>   >   convenience as much as anything.
>   >
>   >   "Also, optional doesn't necessarily mean implied. In fact, are you
>sure
>   >        that UNIQUE implies INDEX?"
>   >
>   >   Yes, a unique one. To perhaps confuse things, so does KEY (KEY is a
>   >   synonym for INDEX).
>   >
>   >   Hmm, I'm not convinced. I'd think the opposite would be preferable in
>   >order to allow a column to be defined as UNIQUE without it being an
>INDEX.
>   >Then again, you might be right but not because of what can be found in
>the
>   >docs.
>
>
>   To ensure that column values are UNIQUE would be horribly inefficient
>   if the column were not indexed.  You'd have to do a full table scan
>   every time you added or modified a column value.
>
>   Agreed but that still doesn't prove anything.


Uh ... what?  What are you expecting to be "proved"?  You were positing
that the MySQL CREATE TABLE syntax should mean something other than what
it *does* mean.  And to say that you can't determine that UNIQUE refers
to an index by reading the documentation is simply silly.  The CREATE TABLE
section says that "INDEX" and "KEY" are synonymous, and it connects "UNIQUE"
with keys.  It doesn't appear to me that the documentation allows an
interpretation of UNIQUE outside of a key/index context.

I can see that the manual might not have an immediately obvious meaning
if you don't know what an index is, but if you do, it's reasonably clear.

-- 
Paul DuBois, paul@stripped
Thread
The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato30 Jul
  • Re: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois30 Jul
    • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato30 Jul
      • RE: The meaning of "UNIQUE idx_user_id (user_id)"indrek siitan30 Jul
        • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
          • RE: The meaning of "UNIQUE idx_user_id (user_id)"indrek siitan31 Jul
  • Re: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois30 Jul
  • RE: The meaning of "UNIQUE idx_user_id (user_id)"indrek siitan30 Jul
    • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
Re: The meaning of "UNIQUE idx_user_id (user_id)"Nick Lindridge30 Jul
  • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato30 Jul
Re: The meaning of "UNIQUE idx_user_id (user_id)"Nick Lindridge31 Jul
  • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
    • RE: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois31 Jul
      • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
        • Re: The meaning of "UNIQUE idx_user_id (user_id)"Benjamin Pflugmann31 Jul
        • RE: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois31 Jul
    • Re: The meaning of "UNIQUE idx_user_id (user_id)"Benjamin Pflugmann31 Jul
Re: The meaning of "UNIQUE idx_user_id (user_id)"Nick Lindridge31 Jul
  • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
  • RE: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois31 Jul
Re: The meaning of "UNIQUE idx_user_id (user_id)"Nick Lindridge31 Jul
  • RE: The meaning of "UNIQUE idx_user_id (user_id)"henrydesiato31 Jul
    • RE: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois31 Jul
    • Re: The meaning of "UNIQUE idx_user_id (user_id)"Mike Wexler31 Jul
      • Re: The meaning of "UNIQUE idx_user_id (user_id)"Paul DuBois31 Jul