title: MySQL DECIMAL storage and max number of digits
body: <p>It's really a quick question but I really can't find the answer to it.
  When you store a number like 57 in a decimal column with max 65 digits, does it take the space for 65 digits to store it or not?</p>
  
  <p>I'm concerned with it because I checked the space used by my table with 4 DECIMAL columns, it said 65536 bytes. Then I decided to set max digit number to 40 for all DECIMAL columns. Then the space used got to 49152 bytes. On second thought I decided to set a max 15 digit length for two of the four columns and the number of bytes used remained the same (49152).</p>
  
  <p>This is what I use to look up the space taken by every table
  SELECT table_name, ((data_length + index_length)) as "size in B" FROM information_schema.tables WHERE table_schema = "db_name"</p>
  
  <p>Thanks</p>