DELETE FROM table WHERE ...#24755
DELETE FROM table WHERE ...#24755myrrc wants to merge 31 commits intoClickHouse:masterfrom myrrc:feature/lightweight-deletes
Conversation
|
There is no syntax |
|
Depends on #28085 |
azat
left a comment
There was a problem hiding this comment.
@myrrc AFAICS right now it only contains:
- parser for DELETE (not enabled)
- new interpreter
- lots of unrelated changes
- does not contains any real implementation for DELETE
Am I right?
If so, and if you are going to keep that "lots of unrelated changes", and you really sure that they are worth it, how about moving them into separate PR, to make implementation of DELETE simpler for possible reviewers?
Hi! Currently, yes. But please keep in mind that this is a draft pull request, so by the time the first prototype is ready, all unrelated changes will be either:
|
|
We can merge syntax part separately. The work was started in #12390. |
|
@Enmk Do you have any plan for the work on the lightweight DELETE? Will this PR contains UPDATE also? |
@alexey-milovidov Hi, we are developers from Tencent Cloud Database team. We've implemented light-weight deletion discussed in #19627 using the mutation mechanism. We look forward to contribute this back to the community. Can you assign this task to us? The following is a example of our implementation: Test SQLs: DROP DATABASE IF EXISTS tencent_test on cluster default_cluster;
CREATE DATABASE tencent_test on cluster default_cluster;
CREATE TABLE tencent_test.t_1 on cluster default_cluster
(
`order_0` UInt64,
`ordinary_1` UInt32,
`ordinary_2` String,
`ordinary_3` UInt32,
`p_time` Date,
`_version` UInt64
)
ENGINE = ReplicatedReplacingMergeTree(_version)
PARTITION BY toYYYYMM(p_time)
ORDER BY order_0;
CREATE TABLE tencent_test.t_1_all on cluster default_cluster as tencent_test.t_1 ENGINE = Distributed(default_cluster, tencent_test, t_1,order_0);
CREATE TABLE tencent_test.t_random_1
(
`ordinary_1` UInt32,
`ordinary_2` String,
`ordinary_3` UInt32
)
ENGINE = GenerateRandom(1, 5, 3);
insert into tencent_test.t_1_all select rowNumberInAllBlocks(),*,NOW(), 1 from tencent_test.t_random_1 limit 100000000;
alter table tencent_test.t_1 delete where order_0 < 100; |
That is some great news! IMO you should go ahead and submit a PR |
|
@weeds085490 please submit PR |
Ok, since we're on the 21.3 kernel version here's some code cleanup and modification work. We will gradually merge the code into the community |
|
@weeds085490 do you have any ETA on this? Or you may even go ahead and push a PR as-is (e.g. into 21.3), and then the core team would be able to validate implementation. And I can help you with porting it atop of master to make things faster. |
OK, we'll do some cleaning work , give our detailed design docs, and submit a PR first... |
|
will this be using indexes as select does? |


I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Lightweight mutations. Unlike ordinary mutations, do not immediately change files, but create a per-part deleted rows mask.
Implementations stages: