Feature Request: Support for Multi-Column Primary Keys with Partitioned Tables
Maintainer thường phản hồi trong vòng 10 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- mysql
- Lĩnh vực
- databases
Hướng nghiên cứu
Bắt đầu bằng cách kiểm tra cách gh-ost hiện đang xử lý khóa chính và các bảng MySQL được phân vùng; issue không nêu tệp, test hoặc entry point nào. Xác định phạm vi và thiết kế cho việc hỗ trợ khóa ghép, sau đó định nghĩa các test bao quát ví dụ về bảng được phân vùng và quá trình di chuyển schema online thành công.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Go
- Star
- 13.6k
- Fork
- 1.4k
- Merge trung bình
- 9 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của github/gh-ost
-
`--resume` without `--execute` drops the ghost table it correctly skipped alteringCó thể đã có người làm @ajm188 đã nhận 55 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 10 ngày
-
[Suggestion] Apply simple validation to alter commandCó thể đã có người làm @drkemp187 đã nhận 106 ngày trước. Đang mởenhancement good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
github/gh-ost#1431 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Migration hangs when --attempt-instant-ddl succeedsCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Maintainer thường phản hồi trong vòng 10 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 10 ngày
-
Atomic cut-over always fails on MySQL 9.1+: information_schema.processlist errors out (3854) while another session runs a non-BMP utf8mb4 statementCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
github/gh-ost#1780 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 10 ngày
Tất cả issue của github/gh-ost
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
prime-radiant-inc/evener#6325 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
team:library-maintainers
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
padok-team/burrito#1208 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
bazel-contrib/rules_go#4784 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
betterleaks/betterleaks#484 ·
Maintainer thường phản hồi trong vòng 1 ngày