title: Mysql - Modify column data type on large table
body: <p>I have a reasonably large InnoDB table (~100gb) in a MySQL 5.7 database. It is backed by a network-attached storage volume, which is a little slow but no problem for my use case.</p>
  
  <p>One of the columns is currently a LONGTEXT but it actually contains serialized objects from memory. LONGTEXT clearly isn't the correct data type - it really should be a LONGBLOB and we're starting to see some code problems because of this.</p>
  
  <p>In a test run of a plain ALTER TABLE ... MODIFY COLUMN ... LONGBLOB, it looked like it was doing a full table copy and rebuild, which was confirmed by the documentation here: <a href="https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl-operations.html#online-ddl-column-operations-table" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/5.7/en/innodb-online-ddl-operations.html#online-ddl-column-operations-table</a>. This would cause too much downtime for me. I tried using both ALGORITHM=INPLACE and LOCK=NONE, but I got errors with both of these. The column which needs modifying is only about 20gb of the 100gb table.</p>
  
  <p>Is there any way to do ALTER TABLE ... MODIFY COLUMN ... LONGBLOB on this column without causing significant downtime (>10 minutes for argument's sake)?</p>