Create all indexes of a migration in one action

Merged
CH
21h ago
+115-96

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

  • index is added to METADATA_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: getDeferredOperation becomes getDeferredOperations and returns a list. The index handler returns one build_index per 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.