docs: MySQL comparison, three-bucket cost model, binary-coercible type changes - #68
Merged
Merged
Conversation
…e changes Restore the MySQL vs PostgreSQL reference the other docs already cited but never shipped, and name the three lock × work-done buckets (catalog-only / full scan / full rewrite) that MySQL's ALGORITHM states map onto so the plan-report reasons have a stated model behind them.
Kiran01bm
marked this pull request as ready for review
September 2, 2026 07:28
Kiran01bm
requested review from
JashLal,
aparajon,
eeSeeGee,
jayjanssen,
jemiahw and
morgo
as code owners
September 2, 2026 07:28
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
aparajon
approved these changes
Sep 2, 2026
Kiran01bm
added a commit
that referenced
this pull request
Sep 4, 2026
Follow-up corrections to the MySQL-comparison and binary-coercible docs from #68: dependency refusals, temporal-precision rewrite reasons, the complete planner-reason cost map, and dead design-doc references. ## Why This commit was pushed to the #68 branch after the PR had merged, so it never reached `main`. Its content fixes factual statements readers would otherwise take as PostgreSQL behaviour: `ALTER COLUMN TYPE` on a column a `STORED` generated column depends on is refused outright, temporal precision reductions rewrite because the rounding survives, and the planner-reason cost map needs to distinguish online forms that scan from those that do not. It also replaces dead design-document references with their live sources. ## What - `binary-coercible-type-changes.md`: move the generated-column case next to the view/rule refusal and correct the bucket-B/C wording for rounding versus stored typmod. Only an `interval` **precision** reduction rewrites; a field-only reduction (`DAY TO SECOND` → `HOUR TO SECOND`) relabels and keeps stored components the new declared type excludes, so it is listed with the assumptions that are wrong in the safe direction. - `postgres-online-ddl-reference.md`: map all planner reasons to their cost buckets, distinguish the two `online-idiom` cost shapes — including `ADD CONSTRAINT … USING INDEX`, catalog-only for a unique adoption and a full scan when adopted as a primary key on a nullable column — and surface dependency refusals beside the `binary-coercible` verdict. - `low-level-design.md`, `high-level-design.md`, `design-principles.md`, `invariants.md`, and `postgresql-version-support.md`: replace dead references with the Spirit README, PostgreSQL primitive mapping, and current implementation-status section. - `plan-report.md` and `capabilities.md`: align the canonical reason and support tables with planner behaviour and PostgreSQL's dependency refusals. ## Before / after ``` Before (origin/main after #68) After generated column + ALTER TYPE: generated column + ALTER TYPE: "not re-recorded; decided on own "refused: cannot alter type of a column transform expression" used by a generated column" interval field/precision reduction: interval precision reduction: rewrites (bucket B) one cell, "rewrites" interval field-only reduction: relabels, stored components survive (safe-direction) reasons -> buckets: incomplete/coarse reasons -> buckets: complete, with online no-scan / full-scan / USING INDEX (conditional) refs: nonexistent design notes refs: Spirit README, PostgreSQL primitive and build-plan files mapping, current implementation status ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Doc-only: adds the MySQL ↔ PostgreSQL comparison reference the docs already cite, a three-bucket cost model on top of the online-DDL reference, and a deep-dive on when
ALTER COLUMN TYPEis a relabel versus a rewrite.Why
Six places in
docs/link to amysql-vs-postgresql.mdthat never existed in this repo, so the lock-queue explanation and the Spirit → PostgreSQL primitive mapping they lean on were unreachable. Separately, the online-DDL reference lists two axes (lock level, rewrite/scan) but never states the synthesis readers actually need — that every PostgreSQL DDL falls into one of three buckets that correspond to MySQL'sINSTANT/INPLACE/COPY— and thebinary-coercibleverdict had a one-line definition with no account of how PostgreSQL decides or which changes only look free.What
docs/mysql-vs-postgresql.md— new: how each engine expresses online DDL, lock-mode → MDL mapping, why DDL is dangerous (the lock-queue pile-up, same in both engines), Spirit → PostgreSQL primitive mapping.docs/postgres-online-ddl-reference.md— new "three buckets" section (catalog-only ≈INSTANT, full scan no rewrite ≈INPLACE, full rewrite ≈COPY) tied to the plan-report reason vocabulary; dangling refs turned into links.docs/binary-coercible-type-changes.md— new: the structural rewrite test inATColumnChangeRequiresRewrite, the four shapes that skip a rewrite and why, six categories of forced rewrite with examples, "looks free but rewrites" (shorteningvarchar,numericscale/precision with row-level before/after,char(n)→text, arrays, non-UTCtimestamp↔timestamptz), what "no rewrite" still costs, catalog/filenode/event-trigger checks, and the exact rules the planner'sbinaryCoercibleaccepts.12-mysql-vs-postgresql.md/ baremysql-vs-postgresqlreferences indesign-principles.md,low-level-design.md,high-level-design.md,invariants.mdnow link to the real sections;docs/README.mdtable updated.No code, contract, or capability changes.
Before / after