Skip to content

Commit 493b851

Browse files
author
Shlomi Noach
committed
adding documentation
1 parent aae0f5c commit 493b851

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

doc/command-line-flags.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Command line flags
2+
3+
A more in-depth discussion of various `gh-ost` command line flags: implementation, implication, use cases.
4+
5+
##### exact-rowcount
6+
7+
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?
8+
`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`](https://www.percona.com/doc/percona-toolkit/2.2/pt-online-schema-change.html).
9+
10+
`gh-ost` also supports the `--exact-rowcount` flag. When this flag is given, two things happen:
11+
- An initial, authoritative `select count(*) from your_table`.
12+
This query may take a long time to complete, but is performed before we begin the massive operations.
13+
- A continuous update to the estimate as we make progress applying events.
14+
We heuristically update the number of rows based on the queries we process from the binlogs.
15+
16+
While the ongoing estimated number of rows is still heuristic, it's almost exact, such that the reported [ETA](understanding-output.md) or percentage progress is typically accurate to the second throughout a multiple-hour operation.

0 commit comments

Comments
 (0)