Create all indexes of a migration in one action
Merged
CH
21h ago+115+115+012345678901234567890123456789-96-96-01234567890123456789
Why
Activating a workspace creates about 130 indexes. Each one is its own create action, which costs two single-row INSERTs (the index, then its index fields) on top of the CREATE INDEX itself. #32407 merged the creates of the simple metadata into one action per migration; indexes were left out because their create also touches the workspace schema and can defer the index build.
What
indexis added toMETADATA_NAMES_WITH_AGGREGATED_CREATE_ACTIONS. The create handler inserts all indexes in one statement and all their index fields in another (in chunks of 500), then creates each index in the workspace schema one by one, as before.- A handler can now return several deferred operations:
getDeferredOperationbecomesgetDeferredOperationsand returns a list. The index handler returns onebuild_indexper deferred index of the action. The six other overrides return the same single operation as before, wrapped in a list.
The schema work is unchanged: same statements, same order, same deferral rule per index. Only the metadata inserts are grouped.
Screenshots
No UI change.