Feature Request: Support for Multi-Column Primary Keys with Partitioned Tables
I maintainer di solito rispondono entro 10 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- mysql
- Ambito
- databases
Direzione di ricerca
Inizia esaminando la gestione esistente delle chiavi primarie e delle tabelle MySQL partizionate in gh-ost; l'issue non indica file, test o punti di ingresso. Determina l'ambito e la progettazione del supporto per le chiavi composte, quindi definisci test che coprano l'esempio della tabella partizionata e una migrazione dello schema online riuscita.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi gh-ost team,
Thank you for maintaining such a powerful and reliable tool for online schema migrations. gh-ost has been a core part of our database operations for minimizing downtime during schema changes.
However, we are currently facing a limitation: gh-ost does not support tables with multi-column (composite) primary keys.
In many production environments, especially those using normalized schemas or advanced partitioning strategies, composite primary keys are a necessity rather than an option.
Let me give you a real-world example from our company.
We manage large, partitioned tables for statistical data. These tables have heavy write loads and massive storage volumes. Here is a simplified version of one of them:
CREATE TABLE partitioned_table (
`id` int unsigned NOT NULL AUTO_INCREMENT,
`data_at` datetime NOT NULL,
...
PRIMARY KEY (`id`, `data_at`)
) ENGINE=InnoDB DEFAULT CHARSET=ascii
/*!50500 PARTITION BY RANGE COLUMNS(data_at)
(PARTITION m2501 VALUES LESS THAN ('2025-02-01') ENGINE = InnoDB,
PARTITION m2502 VALUES LESS THAN ('2025-03-01') ENGINE = InnoDB,
PARTITION m2503 VALUES LESS THAN ('2025-04-01') ENGINE = InnoDB,
PARTITION m2504 VALUES LESS THAN ('2025-05-01') ENGINE = InnoDB,
PARTITION m2505 VALUES LESS THAN ('2025-06-01') ENGINE = InnoDB,
PARTITION mMAX VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB) */
Because of the composite primary key (id, data_at) and the size of the table, using gh-ost would be ideal for safely applying schema changes without significant locking or replication lag.
Unfortunately, the current lack of multi-column primary key support forces us to use alternative tools like pt-online-schema-change for these critical tables, even though gh-ost would be a far better fit for our operational standards.
Supporting multi-column primary keys would greatly extend gh-ost’s usability in real-world, high-load, and partitioned environments like ours.
Even partial or experimental support would already make a big difference.
Is there any plan or consideration to support this in the future?
We would be more than happy to contribute, test, or assist in any way if this feature could be prioritized.
Thanks again for your outstanding work and for considering this request
- Lingua principale
- Go
- Stelle
- 13.6k
- Fork
- 1.4k
- Merge medio
- 9g 19h
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di github/gh-ost
-
`--resume` without `--execute` drops the ghost table it correctly skipped alteringForse già presa @ajm188 l’ha presa 55 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 10 giorni
-
[Suggestion] Apply simple validation to alter commandForse già presa @drkemp187 l’ha presa 106 giorni fa. Apertaenhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
github/gh-ost#1431 · 4 commenti ·
I maintainer di solito rispondono entro 10 giorni
-
Migration hangs when --attempt-instant-ddl succeedsForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
I maintainer di solito rispondono entro 10 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 42/100
I maintainer di solito rispondono entro 10 giorni
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statementForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
github/gh-ost#1780 · 1 commento ·
I maintainer di solito rispondono entro 10 giorni
Tutte le issue di github/gh-ost
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
prime-radiant-inc/evener#6325 ·
I maintainer di solito rispondono entro 1 giorno
-
team:library-maintainers
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
padok-team/burrito#1208 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bazel-contrib/rules_go#4784 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
betterleaks/betterleaks#484 ·
I maintainer di solito rispondono entro 1 giorno