List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:August 15 1999 8:15pm
Subject:Re: ENUM or SET?
View as plain text  
At 12:58 PM -0700 8/15/99, Mark Bean wrote:
>I'm working to enhance my product database.  I have found that my old
>database no longer meets my needs.  I require the ability to
>categorize my products on many levels.  I'm considering categorizing
>my products with six main classification types.  Each of those
>classification types can contain up to ten categories.  Most, if not
>all, classifications will  require only one selection, but some will
>have none.  I do will need the ability to add additional categories in
>the classification types.  For example, I have a cassification type of
>brand, I would need the ability to add new brands when they become
>available.  I could work around the need for one product have multiple
>selections per classification.  I'm not sure if I should use set or
>enum.  Besides for set having the ability to hold more than one
>selection, what are the advantages of one over the other?  Are there
>any speed considerations?
>
>My database is relatively small with only about 200 products.


That in itself may decide the question for you.  A SET can have a
maximum of 64 distinct elements.  An ENUM can have up to 65535.

Either column type can have a "none" value (the empty string, for
example).  Both are implemented internally as numbers, so they're
reasonably efficient.

-- 
Paul DuBois, paul@stripped
Thread
ENUM or SET?Mark Bean15 Aug
  • Re: ENUM or SET?Paul DuBois15 Aug
  • ENUM or SET?sinisa16 Aug
Re: ENUM or SET?Mark Bean15 Aug
RE: ENUM or SET?adhir16 Aug