Sort mutations by table name before applying.
Review Request #5191 — Created Jan. 3, 2014 and submitted — Latest diff uploaded
Sort mutations by table name before applying.
Mutations that span several files end up getting jumbled, preventing the
optimizer from truly living up to its potential.Now, when pre-processing, we rearrange all the mutations to ensure
they're grouped together by table. This should generally be safe,
as mutations don't deal with foreign relations to other tables or
fields.This allows the ALTER TABLE optimizer to do a better job of generating
fewer ALTER TABLE statements.
Unit tests pass.
Checked the output of the RB 1.7.x to 2.0 upgrade. It generated 13
table-rebuildingALTER TABLE
statements, across 13 tables.For comparison, prior to all this work, there were 35 table-rebuilding
statements.