-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
MariaDB 10.3 supports system-versioned tables.
go-dump could support them in several ways:
- It makes no sense to create a table
WITH SYSTEM VERSIONINGbefore backup. Create it as a normal table, then add theINSERTs, then runALTER TABLE ... ADD SYSTEM VERSIONING.- There is a slightly more complicated case to support, where historical data is contained in a separate partition. In that case, the table should be created without partitions and partitions should be created later.
-SET SESSION system_versioning_asof = 'DEFAULT'-- should be issued, to make sure that no implicitFOR SYSTEM_TIMEis added to ourSELECTs.
- There is a slightly more complicated case to support, where historical data is contained in a separate partition. In that case, the table should be created without partitions and partitions should be created later.
- Add an options to decide which historical data is backuped:
- By default include the whole history:
SELECT ... FOR SYSTEM_TIME ALL - History since last backup:
SELECT ... FOR SYSTEM_TIME BETWEEN (NOW() - INTERVAL 1 DAY) AND NOW() - History of a time range:
SELECT ... FOR SYSTEM_TIME FROM <timestamp1> TO <timestamp2> - Backup exact point in time:
SELECT ... FOR SYSTEM_TIME AS OF TIMESTAMP .... Useful to recover data after a mistake.
- By default include the whole history:
I left out many details.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels