Skip to content

docs(cascade): materialization is required by reverse-topo delete order, not just MySQL 1093#208

Open
dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/cascade-materialization-spec
Open

docs(cascade): materialization is required by reverse-topo delete order, not just MySQL 1093#208
dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/cascade-materialization-spec

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

The cascade spec's "Materialization at the Master" section justified materialization purely as a MySQL error 1093 workaround ("which both backends accept"), mirroring a gap also found in the code docstring during the 2.3.1 dj.Diagram review.

The backend-independent reason: Table.delete deletes per-table in reverse-topological order (leaves first), so the originating Part is deleted before its Master. A live master restriction referencing that Part would match zero rows by the time the Master's own DELETE runs — silently stranding the Master on any backend, PostgreSQL included. MySQL 1093 (the self-referential subquery) is a secondary consequence.

This reframes the Materialization section and the Limitations note so the spec cannot be read as licensing a "PostgreSQL has no 1093, so skip it" optimization. Docs-only.

…er, not just MySQL 1093

The cascade spec framed master materialization purely as a MySQL error 1093 workaround ('which both backends accept'). The backend-independent reason: Table.delete deletes in reverse-topological order, so the Part is deleted before the Master; a live master restriction referencing the Part would strand the Master on any backend, PostgreSQL included. Reframe the Materialization section and Limitations note accordingly (MySQL 1093 is a secondary consequence).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant