当前位置:网站首页>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
边栏推荐
- 六、HikariConfig的配置解析
- PAT B1051
- PHP little knowledge record
- Force wechat page font size to be 100%
- String since I can perform performance tuning, I can call an expert directly
- Is it safe to open an online account for new bonds? What should be paid attention to
- 一、HikariCP获取连接流程源码分析一
- Uniapp waterfall flow, applet waterfall flow, very simple, suitable for the whole platform
- Wechat applet connects to the server to display mqtt data information
- JS asynchronism (III. usage of generator and async/await)
猜你喜欢

Avoid material "minefields"! Play super high conversion rate

rmi-registry-bind-deserialization

Applet multi image to Base64 upload

Huawei fast application access advertising service development guide

My official account writing experience sharing

PAT B1086

Panda weekly -2022/02/18
![[harmonyos] [arkui] how can Hongmeng ETS call pa](/img/19/9d2c68be48417e0aaa0d27068a67ce.jpg)
[harmonyos] [arkui] how can Hongmeng ETS call pa

Yaml configuration

Log in to Huawei game with a minor account, and pop up anti addiction prompt after startup
随机推荐
Principles of MySQL clustered index and non clustered index
Number of wechat applet custom input boxes
<C>. Branch and loop statements
JS asynchronism (I. asynchronous concept, basic use of web worker)
Profile path and name
<C>. Calculation date to day conversion
Force wechat page font size to be 100%
Two types of attribute injection methods
My official account writing experience sharing
Randomly generate 100 non repeating numbers between 1 and 150 and put them in the array
Convert word to PDF through libreoffice
Vulnhub range - correlation:2
<C>. Rolling phase division
A necessary programming assistant for programmers! Smartcoder helps you easily integrate HMS core
Web components - Basics
PAT B1061
PAT B1076
Simple native JS tab bar switching
LNMP compilation and installation
Validation of TTF font by validator of laravel