From 73bbd549cfad70d93477368288a4d03bd508c967 Mon Sep 17 00:00:00 2001 From: Cyril Levis Date: Wed, 28 Dec 2022 10:12:28 +0100 Subject: [PATCH] chore: make Prefer_ordering_index=on default value for optimizer_switch --- doc/command-line-flags.md | 4 ++-- go/cmd/gh-ost/main.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/command-line-flags.md b/doc/command-line-flags.md index e88017e5c..5904eaed8 100644 --- a/doc/command-line-flags.md +++ b/doc/command-line-flags.md @@ -288,9 +288,9 @@ Makes the _old_ table include a timestamp value. The _old_ table is what the ori ### optimizer-switch -Default is "", this allow to override a `SET GLOBAL optimizer_switch=key=value` by one set on the session with `SET SESSION optimizer_switch=key=value`. +Default is "prefer_ordering_index=on", this allow to override a `SET GLOBAL optimizer_switch=key=value` by one set on the session with `SET SESSION optimizer_switch=key=value`. You can find values on https://dev.mysql.com/doc/refman/8.0/en/switchable-optimizations.html. -Example: `--optimizer-switch="prefer_ordering_index=on"`. +Example: `--optimizer-switch="prefer_ordering_index=off"`. ### tungsten diff --git a/go/cmd/gh-ost/main.go b/go/cmd/gh-ost/main.go index 7712ee7d0..e6267687e 100644 --- a/go/cmd/gh-ost/main.go +++ b/go/cmd/gh-ost/main.go @@ -139,7 +139,7 @@ func main() { criticalLoad := flag.String("critical-load", "", "Comma delimited status-name=threshold, same format as --max-load. When status exceeds threshold, app panics and quits") flag.Int64Var(&migrationContext.CriticalLoadIntervalMilliseconds, "critical-load-interval-millis", 0, "When 0, migration immediately bails out upon meeting critical-load. When non-zero, a second check is done after given interval, and migration only bails out if 2nd check still meets critical load") flag.Int64Var(&migrationContext.CriticalLoadHibernateSeconds, "critical-load-hibernate-seconds", 0, "When non-zero, critical-load does not panic and bail out; instead, gh-ost goes into hibernation for the specified duration. It will not read/write anything from/to any server") - flag.StringVar(&migrationContext.OptimizerSwitch, "optimizer-switch", "", "Optimizer switch params, eg: prefer_ordering_index=on") + flag.StringVar(&migrationContext.OptimizerSwitch, "optimizer-switch", "prefer_ordering_index=on", "optimizer_switch param") quiet := flag.Bool("quiet", false, "quiet") verbose := flag.Bool("verbose", false, "verbose") debug := flag.Bool("debug", false, "debug mode (very verbose)")