MySQL Forums
Forum List  »  Newbie

Re: using enum versus tiny int and lookup table
Posted by: laptop alias
Date: April 16, 2008 04:07PM

I can't pretend to offer a definitive response but I'll have a stab at an answer:

Enum is marginally quicker, but significantly less flexible.

So, where there's only likely to be a finite number of values ('yes','no','maybe' or 'Alabama','Arkansas'...'Wyoming' - for instance) or where performance is crucial go with enum. Where the likelihood is that values will need to be inserted, modified, or deleted on a fairly regular basis (relative to the no. of queries ordinarily performed on this data), go with tinyint.

I guess it's a judgement call. I prefer the lookup option because it's so easy to see what values are present in the lookup table, and I don't deal with the kinds of tables, or frequency of queries, where performance would ever be an issue.

Options: ReplyQuote

Written By
Re: using enum versus tiny int and lookup table
April 16, 2008 04:07PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.