I have a table with schema
CREATE TABLE traffic (
date Date,
val1 UInt64,
'val2' UInt64
...
) ENGINE = ReplicatedMergeTree(date, (val1, val2), 8192);
the partition key is date here. I want to change the order from (val1, val2) to (val2, val1)
I only way i know is rename this table to someting(traffic_temp), create table with name 'trafic' and ordering (val2, val1) and copy the data from temp to traffic and then delete the temp table.
But the dataset is huge, is there any better way to do it??
No other way. Only
insert select.You can use
clickhouse-copierbut it does the sameinsert select