Repository navigation
PS-10995 [DOCS] -[feedback] PS 8.4 Innodb index creation - #700
patrickbirch wants to merge 4 commits into
Conversation
patrickbirch
commented
Apr 1, 2026
ff92c71 to
9a41d40
Compare
9a41d40 to
fe8f06d
Compare
fe8f06d to
dc85970
Compare
dc85970 to
c3335fd
Compare
c3335fd to
a744b13
Compare
a744b13 to
479f1b8
Compare
479f1b8 to
74864ee
Compare
74864ee to
9b7e978
Compare
9b7e978 to
e5c75cd
Compare
e5c75cd to
66ed3c8
Compare
66ed3c8 to
f9d507f
Compare
f9d507f to
d0022fc
Compare
d0022fc to
d93a0d2
Compare
modified: docs/innodb-expanded-fast-index-creation.md
d93a0d2 to
49e39bc
Compare
inikep
left a comment
There was a problem hiding this comment.
Checked the new text against the Percona Server 8.4 source (sql/sql_table.cc, sql/sql_admin.cc, sql/sys_vars.cc, client/mysqldump.cc, storage/innobase/handler/handler0alter.cc) and the MTR tests for expand_fast_index_creation.
What checks out: default OFF, the three restrictions (non-unique keys only, no foreign keys, no partitioning), the description of upstream ALGORITHM=COPY as row-by-row secondary index maintenance, and the overall two-phase model.
Main problems, detailed inline:
OPTIMIZE TABLE(andALTER TABLE ... ENGINE=InnoDB/FORCE) are in-place rebuilds in 8.4 and never reach the COPY-only delayed-key code, soexpand_fast_index_creationdoes not affect them by default. The PR repeats this claim in many places, including both diagrams.- The variable has no effect on the trailing
ALTER TABLE ... ADD KEYfrommysqldump --innodb-optimize-keys; the two features are independent. - A garbled paragraph in the tmpdir section.
- Four broken
#expand-fast-index-creationanchors (should be#expand_fast_index_creation). - One reversed sentence, a few grammar issues, and diagram labels that contradict the text.
…ding Versions: none added (correction only, no new behavior). Skipped style fixes: style script not run (spacy not installed for python3); judgment applied to changed lines. Conflicts: - expand-fast-creation.png and technical-view-fast-creation.png not regenerated. Both still show OPTIMIZE TABLE and other claims the text no longer makes. - Summary table reviewer note (line 63) has no OPTIMIZE TABLE text. Placeholders: none. Added context: innodb_tmpdir note in phase 2 and tmpdir sections. Change type: correction.
inikep
left a comment
There was a problem hiding this comment.
Review of the technical content against Percona Server 8.4 source (sql/sql_table.cc, sql/sys_vars.cc, client/mysqldump.cc, InnoDB handler0alter.cc) and the feature's MTR tests.
Correct: default OFF, command-line/config-file/session/global (sys_vars.cc); effect limited to the ALGORITHM=COPY path; deferred keys rebuilt with an in-place ADD INDEX, so innodb_tmpdir applies when set; OPTIMIZE TABLE takes the COPY path only with old_alter_table=ON or a FULLTEXT index; UNIQUE keys are never deferred.
Needs fixing (inline): the page confuses rebuild with COPY (column reorder is INPLACE); Phase 2 is one clustered-index scan, not one per index; FULLTEXT and SPATIAL indexes are not deferred; the FK and partitioning restrictions don't match the 8.4 code; the tmpdir margin for the copy belongs on the datadir; the mysqldump FK description contradicts itself and the code; restore doesn't depend on expand_fast_index_creation; both images contradict the text.
The FK and partitioning comments are based on reading the code. Please confirm the runtime behavior on a build.
… scope Versions: none added (correction only, no new behavior). Change type: correction. Scope: - Deferred-index path runs only for ALTER TABLE ... ALGORITHM=COPY. INPLACE rebuilds (column reorder, ROW_FORMAT, ENGINE=InnoDB, ADD PRIMARY KEY) are not affected. - Deferred set is plain KEY indexes (non-unique, non-FULLTEXT, non-SPATIAL). FULLTEXT and SPATIAL are still maintained during the copy. - Phase 2 is one in-place ADD INDEX: one clustered-index scan feeding a separate sort/merge per index, not one scan per index. - mysqldump --innodb-optimize-keys restore does not depend on expand_fast_index_creation. Foreign key CONSTRAINT clauses stay in CREATE TABLE. - Copy-side free space is on datadir; tmpdir (or innodb_tmpdir) holds the index-build sort runs. - Variables table: expand_fast_index_creation Option File set to Yes. Conflicts / open: - FK and partitioning restrictions not yet confirmed on a build. - The mysqldump FK-slower-restore claim is unverified. - expand-fast-creation.png and technical-view-fast-creation.png not regenerated; both still contradict the text. Placeholders: none.
- Foreign keys: optimization is disabled only for tables referenced by another table's FK (including self-references) and for ALTERs that add an FK. An FK on the table itself does not disable it. - Partitioning: only statements that change partitioning disable it. A plain copy-style ALTER or OPTIMIZE on an already-partitioned table can use it. - mysqldump --innodb-optimize-keys: tables with a foreign key to another table are dumped without the optimization. Reason from the source: 'Table was not locked with LOCK TABLES'. - Restore: the variable does not affect the trailing ALTER TABLE ADD KEY on restore. The benefit comes from the rewritten dump file. - tmpdir and datadir: the copy's intermediate table is written to the table's data directory, so the copy needs free space there roughly equal to the rebuilt table. - Verify and monitor: add how to confirm the optimization ran using the stage/sql/restoring secondary keys stage. - Rename the dump-structure heading to 'Dump file structure' so the anchor is the same under both Python-Markdown and pymdownx slugify. - Remove the two comparison graphics for now; they are being regenerated. Behavior checked on Percona Server 8.4.13-13.