header
 
     
 
pixel
pixel pixel

Use smallest datatype

When creating a new column in your database table, use the smallest datatype that will hold the information you expect to store. Most of the time, using INT is overkill as MEDIUMINT, SMALLINT, or TINYINT have enough range. Using a smaller datatype saves space and speeds things up.
Unhelpful Helpful Rating 3.0 (score out of 5, no. of ratings: 2)
Comments
Comment by Ken H. on 2005-06-23
Your tip is true, but would be more useful if you stated how many bytes int, mediumint, etc. require and the maximum positive and negative values that they can store.

Post a Comment
Name
Email
(optional)
Comment
RatingUnhelpful Helpful
Security Image* (this is just to prevent spam submissions)
Security Image