Merge pull request #45582 from mrcrypster/patch-4

DELETE + WHERE in TTL
This commit is contained in:
Anton Popov 2023-02-10 14:27:54 +01:00 committed by GitHub
commit ccf7b6f4c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -611,7 +611,10 @@ Type of TTL rule may follow each TTL expression. It affects an action which is t
- `TO VOLUME 'bbb'` - move part to the disk `bbb`;
- `GROUP BY` - aggregate expired rows.
With `WHERE` clause you may specify which of the expired rows to delete or aggregate (it cannot be applied to moves or recompression).
`DELETE` action can be used together with `WHERE` clause to delete only some of the expired rows based on a filtering condition:
``` sql
TTL time_column + INTERVAL 1 MONTH DELETE WHERE column = 'value'
```
`GROUP BY` expression must be a prefix of the table primary key.