Skip to content

[Subtask]: Cut over to MULTI_UPDATE and remove the legacy UPDATE planner #26343

Closed

Description

@XuPeng-SH

Parent issue

#26336

Objective

Perform the final cutover only after every reachable UPDATE route has a modern, named-specialized, or explicit-error disposition and the observation window shows no unexplained legacy use.

Required work

  • Remove the generic ErrUnsupportedDML -> buildTableUpdate branch from bindAndOptimizeUpdateQuery.
  • Delete buildTableUpdate after repository call-graph proof that it has no caller.
  • Remove helpers and branches only when they are UPDATE-specific and unreachable.
  • Preserve shared INSERT, DELETE, LOAD, REPLACE, FK-recursion, and index-maintenance utilities in build_dml_util.go and elsewhere.
  • Audit PreInsert UniqueKey / PreInsert SecondaryKey consumers. Remove UPDATE-specific Rowid behavior only if no remaining non-UPDATE plan depends on it; do not delete shared operators based on name alone.
  • Port valuable legacy behavior tests to modern plan/SQL tests before deleting implementation-coupled assertions.
  • Add a regression guard that prevents reintroduction of a generic UPDATE fallback.

Entry criteria

Acceptance criteria

  • bindAndOptimizeUpdateQuery contains no generic call to buildTableUpdate.
  • buildTableUpdate has no caller and is deleted.
  • Shared DML code remains unless independent call-graph/test evidence proves it dead.
  • No normal-table UPDATE plan contains legacy UPDATE-only PRE_INSERT_UK / PRE_INSERT_SK staging; modern and named-specialized controls are asserted separately.
  • Every supported UPDATE form produces MULTI_UPDATE or an explicitly named specialized plan.
  • Every unsupported form fails before mutation with a stable error.
  • Planner comments/docs and route telemetry no longer describe the legacy UPDATE planner as active.
  • Targeted pkg/sql/plan, affected colexec/index-plugin packages, and distributed UPDATE/FK/index suites pass.
  • Required repository CI passes, including optimistic/pessimistic conflict/retry, cancellation, and rollback coverage for migrated routes.
  • A source-level or plan-test guard fails if a future arbitrary ErrUnsupportedDML is routed to a legacy UPDATE builder.

Deletion checklist

  • Produce a before/after call graph for buildTableUpdate and candidate helpers.
  • Classify each candidate as UPDATE-only, shared, or still reachable.
  • Port behavior tests before deleting legacy-only tests.
  • Verify no orphaned protobuf node handling, explain formatting, metrics, or comments remain.
  • Verify [Bug]: nullable index UPDATE keeps Rowid from filtered NULL row #26334's fix is retained even if its UPDATE-specific code later becomes removable; other DML consumers must remain safe.

Dependencies

Metadata

Metadata

Assignees

Labels

area/optimizerattention/refactor-relatedkind/subtaskseverity/s0

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions