github / github/gh-ost

Defer Index Creation [feature request]?

Open
#250 15 comments 0 reactions 0 assignees View on GitHub
enhancement feature performance
Dominant language
Go
Stars
13.6k
Forks
1.4k
Avg merge
2h 31m
Merged PRs (30d)
4

Description

I'm trying to speed up a gh-ost alter of a gigantic table, and I was wondering if you'd considered deferring index creation until after the main backfill? I imagine it'd go a lot faster if the initial table had no indexes, we did the bulk copy of all of the existing rows, then we paused and did a full `ALTER TABLE` to create the secondary indexes, then gh-ost replayed the binlog to finish the migration.

I could probably do something like this myself by specifying an alter to gh-ost which drops all indexes, then throttling gh-ost through the control socket, when it gets to 99%, running the `ALTER TABLE` on the `_gho` table to add the missing indexes, and un-throttling gh-ost once the ALTER finishes in replication, but that seems failure-prone.

Alternatively, if you have any tips for making rewrites go faster on terabyte-scale tables, I'm all ears. :-)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.