1.8 KiB
Command line flags
A more in-depth discussion of various gh-ost
command line flags: implementation, implication, use cases.
cut-over
Required. You are asked to explicitly state which cut-over algorithm you wish to use. Please see more discussion on cut-over
exact-rowcount
A gh-ost
execution need to copy whatever rows you have in your existing table onto the ghost table. This can, and often be, a large number. Exactly what that number is?
gh-ost
initially estimates the number of rows in your table by issuing an explain select * from your_table
. This will use statistics on your table and return with a rough estimate. How rough? It might go as low as half or as high as double the actual number of rows in your table. This is the same method as used in pt-online-schema-change
.
gh-ost
also supports the --exact-rowcount
flag. When this flag is given, two things happen:
- An initial, authoritative
select count(*) from your_table
. This query may take a long time to complete, but is performed before we begin the massive operations. - A continuous update to the estimate as we make progress applying events. We heuristically update the number of rows based on the queries we process from the binlogs.
While the ongoing estimated number of rows is still heuristic, it's almost exact, such that the reported ETA or percentage progress is typically accurate to the second throughout a multiple-hour operation.
noop
Do cheks; create ghost table and verify migration would be valid, but do not actually migrate and do not touch data.
test-on-replica
Issue the migration on a replica; do not modify data on master. Useful for validating, testing and benchmarking. See test-on-replica