当前位置:网站首页>Clickhouse disables automatic clearing of tables / columns, that is, disables TTL
Clickhouse disables automatic clearing of tables / columns, that is, disables TTL
2022-06-25 20:04:00 【The ninth tree】
1、 Problem solving
Found in the morning clickhouse There is no data in the table , After some screening , Found to be TTL( Life cycle ) The pot .
It may be installation clickhouse It was configured carelessly , But a search is all about revision TTL The time of the , That is, when the data in the table is automatically deleted , But you don't want to delete data automatically .
Found clues in official documents :
Just run this under the desired table
# Discontinue use TTL
SYSTEM STOP TTL MERGES
# Turn on TTL
SYSTEM START TTL MERGES
2、 test
according to clickhouse Secondary data TTL Test code in :
Create a containing TTL by 30 Second data table , That is, the data in the table 30 Seconds automatically delete !
CREATE TABLE stu
(
id Int32 ,
name String ,
create_time DateTime
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(create_time)
ORDER BY id TTL create_time + INTERVAL 30 second
insert data :
insert into stu values
(100,'tom',now()),
(101,'jack',now()),
(102,'mary',now()),
(103,'lili','2021-08-18 07:12:34');
adopt datagrip The software observes the tables created , And inserted data 
wait for 30 Second, you will find that the data will be deleted , Explain the TTL It's on , If you want to disable , that :
# Discontinue use TTL
SYSTEM STOP TTL MERGES

It will not be cleared automatically after waiting for 30 seconds .
complete
边栏推荐
- Wechat applet connects to the server to display mqtt data information
- How to understand var = a = b = C = 9? How to pre parse?
- PAT B1071
- Uniapp waterfall flow, applet waterfall flow, very simple, suitable for the whole platform
- Est - il sûr d'ouvrir un compte avec de nouvelles dettes? Une faible Commission est - elle crédible?
- 2.1 write a program to calculate the sum and average of four integers.
- 2.4 finding the sum of the first n terms of the interleaved sequence
- How do I delete an entity from symfony2
- My official account writing experience sharing
- PAT B1086
猜你喜欢

Vulnhub range - the planes:venus

Jsonp function encapsulation

JS asynchronism (I. asynchronous concept, basic use of web worker)

Wechat applet swiper simple local picture display appears large blank

Print 1 cute every 100 milliseconds ~ with a running lantern effect

Vulnhub range the planes: mercury

PAT B1076

Determine whether it is a web page opened on wechat

2.3 partial sum of square and reciprocal sequences

What should I pay attention to in GoogleSEO content station optimization?
随机推荐
PHP FPM, workman, spoole, golang simple performance test
Applet password input box
<C>. Branch and loop statements
New features of redis 6.0: take you 100% to master the multithreading model
Arduino : No such file or directory
What are Baidu collection skills? 2022 Baidu article collection skills
Avoid material "minefields"! Play super high conversion rate
PostgreSQL change table owner
How to understand var = a = b = C = 9? How to pre parse?
JS mobile phone and computer open different websites
Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
PAT B1056
2.14(Knight Moves)
Huawei HMS core launched a new member conversion & retention prediction model
Uni app through uni Navigateto failed to pass parameter (pass object)
在打新債開戶證券安全嗎?低傭金靠譜嗎
通过启牛学堂开的股票账户可以用吗?资金安全吗?
Applet wx Request encapsulation
<C>. Calculation date to day conversion
Single chip microcomputer line selection method to store impression (address range) method + Example