ALTER TABLE DEDUP ENABLE
Enable storage level data deduplication on inserts and configures UPSERT KEYS
.
note
- Deduplication can only be enabled for Write-Ahead Log (WAL) tables.
- Enabling deduplication does not have any effect on the existing data and only applies to newly inserted data. This means that a table with deduplication enabled can still contain duplicate data.
- Enabling deduplication does not have any effect on modifying data with
UPDATE
statements.
#
SyntaxUPSERT KEYS
list can include one or more columns with the following rules:
- The designated Timestamp column must be included in the
UPSERT KEYS
list. - Columns of STRING and BINARY types cannot be used in the
UPSERT KEYS
list.
Running ALTER TABLE DEDUP ENABLE
on a table that already has deduplication enabled is not an error.
In such cases, the UPSERT KEYS
list overrides the previously set key column list.
#
ExampleTo enable deduplication on the TICKER_PRICE
table for the ts
and ticker
columns, where ts
is the designated timestamp for the table, use the following command:
See more example at data deduplication page