2

I have a table having following columns: (id, col1,col2). I need to add col3 from a temporary table having (id,col3). So that after the operation table 1 should be: (id,col1,col2,col3) . After this, I drop the temporary table. How can this be done in Clickhouse?

I know of an approach that uses join table engine. However, join table data is stored in memory and I have memory resitrictions. How can I achieve the same result by not creating a in-memory table?

1 Answers1

1

There is no magic in this realm. And the spoon does exists.

You can use that approach with samples and make many updates. Piece by piece by 10% for example.

Denny Crane
  • 11,574
  • 2
  • 19
  • 30
  • I need one clarification, Won't I have to keep the temp join table in memory and wait until **optimize table final** is finished. Otherwise, if I drop the temporary join table before the actual update is done, and create a new one to get from the next sample (i.e. next 10%) when the mutation runs in the background, it will fetch from this new temporary join table. – photographyraptor Sep 28 '20 at 09:09
  • 1
    You need to wait until alter is finished. Then move to next 10%. Check `select from system.mutations where not is done` – Denny Crane Sep 28 '20 at 16:28