Optimizing Data Size 8.4.1 Optimizing Data Size Table Columns Row Format 1733 The compact family of row formats also optimizes  CHAR  column storage when using a variable-length character set such as  utf8mb3  or  utf8mb4 . With  ROW_FORMAT=REDUNDANT ,  CHAR( N )  occupies  N  × the maximum byte length of the character set. Many languages can be written primarily using single-byte utf8  characters, so a fixed storage length often wastes space. With the compact family of rows formats, InnoDB  allocates a variable amount of storage in the range of  N  to  N  × the maximum byte length of the The compact family of row formats, which includes  COMPACT ,  DYNAMIC , and  COMPRESSED , decreases row storage space at the cost of increasing CPU use for some operations. If your workload is a typical one that is limited by cache hit rates and disk speed it is likely to be faster. If it is a rare case that is limited by CPU speed, it might be slower. • InnoDB  tables are created using the  DYNAMIC  row format by default. To use a row format other than DYNAMIC , configure  innodb_default_row_format , or specify the  ROW_FORMAT  option explicitly in a CREATE TABLE  or  ALTER TABLE  statement. •Declare columns to be  NOT NULL  if possible. It makes SQL operations faster, by enabling better use of indexes and eliminating overhead for testing whether each value is  NULL . You also save some storage space, one bit per column. If you really need  NULL  values in your tables, use them. Just avoid the default setting that allows  NULL  values in every column. •Use the most efficient (smallest) data types possible. MySQL has many specialized types that save disk space and memory. For example, use the smaller integer types if possible to get smaller tables. MEDIUMINT  is often a better choice than  INT  because a  MEDIUMINT  column uses 25% less space. •Normalization •Joins •Indexes •Row Format •Table Columns You can get better performance for a table and minimize storage space by using the techniques listed here: MySQL supports many different storage engines (table types) and row formats. For each table, you can decide which storage and indexing method to use. Choosing the proper table format for your application can give you a big performance gain. See Chapter 15,  The InnoDB Storage Engine , and Chapter 16, Alternative Storage Engines . Design your tables to minimize their space on the disk. This can result in huge improvements by reducing the amount of data written to and read from disk. Smaller tables normally require less main memory while their contents are being actively processed during query execution. Any space reduction for table data also results in smaller indexes that can be processed faster. so that performance stays high as the data volume increases. Starting with an efficient database design makes it easier for team members to write high-performing application code, and makes the database likely to endure as applications evolve and are rewritten.