Skip to content

re-order diff output: Create new INDEX and FOREIGN KEYS immediately after the TABLE #70

Description

@nielm

In the [Spanner update Schema docs](https://cloud.google.com/spanner/docs/schema-updates#large-updates:

It's best practice to create the indexes immediately following the table in the list of DDL statements.

The reason for this is that if any other statements occur between the creation of a table and an index referencing that table, the index creation becomes a more complex operation requiring backfill, and cannot be batched with other statements.

The same applies to foreign key creation -- as the creation of a foreign key requires a backing index on the referencing columns

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions