Tiny fun with TINYINT data type

We have found one legacy problem in our database. In one small table used as list of values primary key column ID was designed as TINYINT(4). Generally there is no difference between TINYINT(2) or (3) or (4) – this data type take only 1 byte. INT-like data types...

Partitioning

Several types of partitioning: most common – RANGE on some column, usually based on DATETIME CREATE TABLE somebiglog ( log_date DATETIME NOT NULL, column1 INTEGER, column2 VARCHAR(255) ) ENGINE=InnoDB PARTITION BY RANGE(YEAR(log_date)*10000+MONTH(log_date)) (...

String types

VARCHAR and CHAR, implementation depends on storage engine VARCHAR – variable length CHAR – fixed length: for example for MD5 hashes better then VARCHAR for masivelly changed data BLOB and TEXT – for large binary or text data whole family of types:...