MySQL ROW_FORMAT
MySQL ROW_FORMAT is a SQL statement in the MySQL Specific category. MySQL: row format affects storage efficiency. DYNAMIC (default for InnoDB) handles variable-length fields well. The syntax is CREATE TABLE t (...) ROW_FORMAT=DYNAMIC;. It returns row format setting. A typical example: CREATE TABLE articles ( id INT PRIMARY KEY, title VARCHAR(255), body TEXT, tags JSON ) ROW_FORMAT=DYNAMIC; -- Row formats for InnoDB: -- REDUNDANT: legacy format (MySQL < 5.0) -- COMPACT: default before MySQL 5.7 -- DYNAMIC: default since MySQL 5.7 (variable-length efficient) -- COMPRESSED: compresses data and indexes (saves space, uses CPU) -- COMPRESSED example: CREATE TABLE logs ( id INT, message TEXT ) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8; -- Compresses InnoDB pages… A close relative is AUTO_INCREMENT, which mySQL auto-generates sequential integer values for this column. Commonly used with PRIMARY KEY. A close relative is ENGINE, which specifies the MySQL storage engine. InnoDB (default) supports transactions and foreign keys. MyISAM is faster for read-heavy.