← Graph

Table swap via empty copy

concept 3 connections

Data-split technique from Apply4: create an empty copy of the source table, insert only the records that should remain (e.g. only this region's rows), then rename the original to `<table>_old` and rename the copy to the original name. Watch out for constraints and auto-increment values; leave a ~10% ID buffer in one region to avoid ID clashes between the two regions for a while. Proved faster than deleting the cross-region rows from the live table based on the team's tests.

category
practice
about
Table swap via empty copy concept
Explains the empty-copy + rename strategy for separating per-region tables.
about
Table swap via empty copy concept
Directly about the empty-copy + rename technique used by Apply4.
concept Table swap via empty copy
related_to
Bucketing concept
Table swap is the physical separation step that consumes bucket assignments.

Provenance

Read by
1 extraction