I have a particular scenario where I need to truncate and batch insert into a Table in ClickHouse DBMS for every 30 minutes or so. I could find no reference of truncate option in ClickHouse.
However, I could find suggestions that we can indirectly achieve this by dropping the old table, creating a new table with same name and inserting data into it.
With respect to that, I have a few questions.
- How is this achieved ? What is the sequence of steps in this process ?
- What happens to other queries such as Select during the time when the table is being dropped and recreated ?
- How long does it usually take for a table to be dropped and recreated in ClickHouse ?
- Is there a better and clean way this can be achieved ?