DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(mysql.info) choosing-types

Info Catalog (mysql.info) storage-requirements (mysql.info) data-types (mysql.info) other-vendor-data-types
 
 11.6 Choosing the Right Type for a Column
 =========================================
 
 For optimum storage, you should try to use the most precise type in all
 cases. For example, if an integer column is used for values in the
 range from `1' to `99999', `MEDIUMINT UNSIGNED' is the best type. Of
 the types that represent all the required values, this type uses the
 least amount of storage.
 
 Tables created in MySQL 5.0.3 and above uses a new storage format for
 `DECIMAL' columns. All basic calculation (`+,-,*,/') with `DECIMAL'
 columns are done with precision of 65 decimal (base 10) digits.  See
  numeric-type-overview.
 
 Calculations on `DECIMAL' values are performed using double-precision
 operations. If accuracy is not too important or if speed is the highest
 priority, the `DOUBLE' type may be good enough. For high precision, you
 can always convert to a fixed-point type stored in a `BIGINT'. This
 allows you to do all calculations with 64-bit integers and then convert
 results back to floating-point values as necessary.
 
Info Catalog (mysql.info) storage-requirements (mysql.info) data-types (mysql.info) other-vendor-data-types
automatically generated byinfo2html