For various reasons it'd be really nice to have all the tables in MySQL optimized from time to time:
- Getting table stats in order to avoid optimizer picking the wrong query plan (stuff like T305427)
- Reclaiming space when tables shrink for various reasons.
- which also would reduce the time to clone a replica.
- and save space on backups too
- Reducing rand disk lookups due to having fragmented data.
There are two options (that are not mutually exclusive):
- After every DC switchover, when the whole dc is depooled. run optimize table on every table with replication.
- A script that wold go around and do the work in the background (reusing the auto_schema code).
I think doing it every quarter or half a year would be fine. More than that, it'll be too much work for too little gain.

