OPTIMIZE TABLE is a rebuild wearing a friendly name

For InnoDB, OPTIMIZE TABLE is mapped to an ALTER TABLE ... FORCE, which copies the whole table.

OPTIMIZE TABLE webhooks;
-- Table does not support optimize, doing recreate + analyze
-- instead

-- on 41 million rows: a copy, and a metadata lock at the
-- start and the end.

-- so it belongs behind the same tooling as any other
-- schema change:
--   gh-ost --alter="ENGINE=InnoDB" ...

The friendly name is the problem: it sounds like a maintenance command and is a table rebuild with the same risks as any other. Running it through the same online-schema-change tooling as a real migration is the version that is safe on a large table, and knowing that ENGINE=InnoDB is the no-op alter that forces a rebuild is the trick that makes it possible.