Describe the problem
CREATE TABLE t (i INT PRIMARY KEY);
EXPLAIN (ddl, viz) ALTER TABLE t ADD COLUMN j INT NOT NULL UNIQUE DEFAULT 34;
generates a graph like this one.
This graph is incorrect in that, during Post-Commit phase stage 7 of 13, the newly added column element transition into PUBLIC when the new primary index is ready and we swap it with the old primary index. However, the added unique index (created as a result of adding a unique column) is still in the BACKFILL_ONLY status before/after this stage.
The correct behavior should be that the primary index swap waits until the unique secondary index is also in the VALIDATED status, and then we do the primary index swap as well as making the unique secondary index PUBLIC in one stage.
Describe the problem
generates a graph like this one.
This graph is incorrect in that, during Post-Commit phase stage 7 of 13, the newly added column element transition into PUBLIC when the new primary index is ready and we swap it with the old primary index. However, the added unique index (created as a result of adding a unique column) is still in the BACKFILL_ONLY status before/after this stage.
The correct behavior should be that the primary index swap waits until the unique secondary index is also in the VALIDATED status, and then we do the primary index swap as well as making the unique secondary index PUBLIC in one stage.