List:General Discussion« Previous MessageNext Message »
From:Martijn Tonies Date:November 28 2005 7:31pm
Subject:Re: Seeking Opinions
View as plain text  
> > > Part of me agrees with you, on a "Pure SQL level". but then why would
> > > anyone ever use ENUM or SET?
> >
> > I wouldn't :-)
> >
> > IMO, they're abominations that are to be avoided.
>
> Again, part of me agrees with you.  But part of me, particularly the
> part that says "our queries need to be optimized as much as possible,
> so our customers will be happy," thinks that ENUM and SET are
> non-standard, MySQL specific ways to create normalized data without
> having an extra table, and thus an extra join, and thus more
> computation, and thus a slower query.

That's wrong, if you use "set", the data isn't normalized cause you're
storing multiple values in a column.

> Tell me, do you also create your own sequences in MySQL instead of
> using the AUTO_INCREMENT feature?  Because that, too, is an
> abomination in the same way.

One way to do it is to create an auto-inc table, but this is besides
the point for ENUM/SET.

> I use ENUM a lot, successfully, and when I want to add another ENUM
> value to a table (I never delete one), I have a script that runs a
> show table, gets the ENUM field in question, gets all the values, and
> alters the table modifying the column with the correct values (all the
> current values + the new one).  I've never had a problem with it yet
> (knock wood).

In other words: modifying metadata to adjust the system for data
requirements ;-) ... This also means there's no easy way to automate
this.

--
Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Server
Upscene Productions
http://www.upscene.com
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com

Thread
Seeking OpinionsRobb Kerr25 Nov
  • Re: Seeking OpinionsSGreen25 Nov
  • Re: Seeking OpinionsRhino25 Nov
  • Re: Seeking OpinionsJohan25 Nov
    • Re: Seeking OpinionsHal Vaughan25 Nov
  • Re: Seeking OpinionsRobb Kerr25 Nov
    • Re: Seeking OpinionsJohan26 Nov
      • Re: Seeking Opinionssheeri kritzer28 Nov
        • Re: Seeking OpinionsSGreen28 Nov
          • Re: Seeking Opinionssheeri kritzer28 Nov
        • Re: Seeking OpinionsMartijn Tonies28 Nov
          • Re: Seeking Opinionssheeri kritzer28 Nov
        • Re: Seeking OpinionsMartijn Tonies28 Nov
          • Re: Seeking Opinionssheeri kritzer28 Nov
        • Re: Seeking OpinionsMartijn Tonies28 Nov
        • Re: Seeking OpinionsHarald Fuchs29 Nov