Skip to content

SYSTEM Cited by 4 sources

pt-online-schema-change

Definition

pt-online-schema-change (pt-osc) is the trigger-based online schema change tool for MySQL shipped as part of Percona Toolkit. Historically the first production tool to implement the shadow- table online schema change pattern, pt-osc works by creating a shadow table with the new schema, installing synchronous triggers on the original table to mirror every INSERT/UPDATE/DELETE into the shadow, and batch-copying historical rows until the shadow converges — then atomically swapping table names at cut-over.

Official docs: docs.percona.com/percona-toolkit/pt-online-schema-change.html.

Positioning

pt-osc is the predecessor of gh-ost (GitHub, 2016) and the newer spirit (CashApp). All three implement the same four-phase shadow-table shape; the key distinction is how concurrent writes are captured:

  • pt-osc: synchronous triggers on the original table fire on every write, mirroring into the shadow. Simple, works anywhere MySQL supports DDL triggers — but adds write-path latency to every production query during the migration and requires trigger-DDL privileges.
  • gh-ost: triggerless. Tails the binlog from a replica, decoupling migration load from the primary's write path. Pauseable and externally observable. See systems/gh-ost.
  • spirit: binlog-based like gh-ost, with additional automation for INSTANT-DDL-eligibility detection. See systems/spirit.
  • Vitess VReplication: same substrate, integrated with Vitess sidecar-state management; uniquely keeps the stream alive post-cutover to enable instant schema revert.

Why it shows up on this wiki

pt-osc is named by multiple PlanetScale posts as the canonical prior-art reference for the shadow-table pattern. The 2024 Noach survey notes it alongside gh-ost, spirit, and Vitess in the third-party-tools class; the 2021 Burns launch post names it as one of the two mechanisms that PlanetScale's managed deploy-request workflow wraps.

This page exists primarily as an anchor target for cross-references from the dozens of wiki pages that mention pt-osc by name. Deep mechanism treatment lives on patterns/shadow-table-online-schema-change (the pattern) and systems/gh-ost (the best-documented instantiation on the wiki).

Seen in

  • sources/2026-04-21-planetscale-the-state-of-online-schema-migrations-in-mysql — Shlomi Noach (PlanetScale, 2024-07-23). Canonical wiki class-membership disclosure: pt-osc is one of four third-party shadow-table tools (pt-osc, gh-ost, spirit, Vitess) that share the six-property operational profile (mimic-alter + slower + extra- disk + binlog-bloat + throttle-respecting + batched- interruptible). Unlike vitess and spirit, pt-osc does not auto-detect INSTANT-DDL eligibility — the tool always runs the shadow-table path.

  • sources/2026-04-21-planetscale-non-blocking-schema-changes — Lucy Burns (PlanetScale, 2021-05-20). Names pt-osc alongside gh-ost as the two prior-art online schema change tools that PlanetScale's managed deploy- request workflow wraps.

  • sources/2026-04-21-planetscale-the-operational-relational-schema-paradigm — Shlomi Noach (PlanetScale, 2022-05-09). References pt-osc as mechanism-altitude instantiation of tenets 1 + 2 + 5 + 7 of the [[concepts/operational- relational-schema-paradigm|operational relational schema paradigm]].

Last updated · 470 distilled / 1,213 read