Data Scrubbing

Availability:This feature is tech preview quality

The DELETE statement does the following:

  • Marks the rows as deleted
  • Added to unused
  • Records the deleted row position
  • Records the time when delete was committed

The data is not immediately removed from disk storage. When a new row is inserted, the row is stored without fragmentation in a page with free space. The deleted data remains on the disk until new data overwrites it.

Using Data Scrubbing, you have two options to remove the data and reclaim the space:

Once enabled, data scrubbing works automatically on each tablespace.

To enable data scrubbing, you must enable either one or both of the following variables:

  • innodb-background-scrub-data-uncompressed
  • innodb-background-scrub-data-compressed

Uncompressed tables can also be scrubbed immediately, independent of key rotation or background threads. Setting the variable innodb-immediate-scrub-data-uncompressed enables this operation. This variable does not support operations on compressed tables.

For background scrubbing, you must set the innodb_encryption_threads variable to a value greater than zero when you enable data scrubbing. Intermediate scrubbing does not use encryption threads. A separate thread performs log scrubbing.

System Variables

variable innodb_background_scrub_data_compressed
Command Line:--innodb-background-scrub-data-compressed
Variable Type:Boolean
Default Value:OFF

Enables compressed data scrubbing.

variable innodb_background_scrub_data_uncompressed
Command Line:--innodb-background-scrub-data-uncompressed
Variable Type:Boolean
Default Value:OFF

Enables uncompressed data scrubbing.

variable innodb_scrub_log
Command Line:--innodb-scrub-log
Variable Type:Boolean
Default Value:OFF

Enables redo log scrubbing.

variable innodb_scrub_log_speed
Command Line:--innodb-scrub-log-speed
Variable Type:Numeric
Default Value:256

Defines the scrubbing speed in bytes/sec of the redo log.

variable innodb_immediate_scrub_data_uncompressed
Command Line:--innodb-immediate-scrub-data-uncompressed
Variable Type:Boolean
Default Value:OFF

Enables data scrubbing of uncompressed data.

See also

Vault Documentation
General-Purpose Keyring Key-Management Functions

Contact Us

For free technical help, visit the Percona Community Forum.
To report bugs or submit feature requests, open a JIRA ticket.
For paid support and managed or professional services, contact Percona Sales.