Results 1 to 3 of 3

Thread: best datatype

  1. #1
    Join Date
    May 2004

    Unanswered: best datatype

    i just wonder what's the most oprimized datatype for storing number between 1-10. is it tinyint or define ENUM?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    tiny int
    it allows you to cater for change. ie you may think youonly need 10 now, your users may come upo with ever more creative values. if its an ENUM it requires design chanegs, if its a FK to another table its a data change with minimum impact on development resources.

    Also depending on the implementation the ENUM may impact on use elsewhere (this is applicable if you are using Access/JET).

    A change in term or description requires changes to the table with an ENUM
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2011
    I agree, go with tinyint for the reasons provided.

    The storage required for a tinyint is 1byte, and the storage required for an enum with 10 values is 1byte as well. So, no difference in row size between the two.

    MySQL :: MySQL 5.0 Reference Manual :: 10.5 Data Type Storage Requirements

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts