Feature Request: Support for Multi-Column Primary Keys with Partitioned Tables
Les mainteneurs répondent en général sous 10 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- À clarifier
- Activité
- À l'abandon
- Stack technique
- mysql
- Domaine
- databases
Piste de recherche
Commencez par examiner la gestion existante des clés primaires et des tables MySQL partitionnées dans gh-ost ; l’issue ne nomme aucun fichier, test ni point d’entrée. Déterminez la portée et la conception de la prise en charge des clés composites, puis définissez des tests couvrant l’exemple de table partitionnée et une migration de schéma en ligne réussie.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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
- Langage dominant
- Go
- Étoiles
- 13.6k
- Forks
- 1.4k
- Merge moyen
- 9 j 19 h
- PR mergées (30 j)
- 1
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de github/gh-ost
-
`--resume` without `--execute` drops the ghost table it correctly skipped alteringPeut-être pris @ajm188 l’a pris il y a 56 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 86/100
Les mainteneurs répondent en général sous 10 jours
-
[Suggestion] Apply simple validation to alter commandPeut-être pris @drkemp187 l’a pris il y a 106 jours. Ouverteenhancement good first issue
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
github/gh-ost#1431 · 4 commentaires ·
Les mainteneurs répondent en général sous 10 jours
-
Migration hangs when --attempt-instant-ddl succeedsPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
Les mainteneurs répondent en général sous 10 jours
-
Difficulté 4/5 3-5 jours Accessibilité débutants 42/100
Les mainteneurs répondent en général sous 10 jours
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statementPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
github/gh-ost#1780 · 1 commentaire ·
Les mainteneurs répondent en général sous 10 jours
Toutes les issues de github/gh-ost
Issues similaires
-
[Docs] Four internal links return 404 (Models concept, Contributing to Docs, Providers reference)Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
meshery/meshery#23520 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
flaky: execenv TestRelayControlledCancelAndDirectParentDeath reads an empty pid file under loadOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
SocialGouv/iterion#3263 ·
Les mainteneurs répondent en général sous 1 jour
-
Container registry refuses image names with "__" or "--" (NAME_INVALID), which the OCI distribution spec allows since v1.1.0Peut-être pris @lazerg l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Unsupported language versionOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
itadori26/trisse-home#226 ·
Les mainteneurs répondent en général sous 1 jour