惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
Cloudbric
Cloudbric
G
GRAHAM CLULEY
S
Securelist
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Project Zero
Project Zero
Spread Privacy
Spread Privacy
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
T
Tailwind CSS Blog
博客园_首页
有赞技术团队
有赞技术团队
Simon Willison's Weblog
Simon Willison's Weblog
Stack Overflow Blog
Stack Overflow Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Latest news
Latest news
T
Tor Project blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Attack and Defense Labs
Attack and Defense Labs
www.infosecurity-magazine.com
www.infosecurity-magazine.com
O
OpenAI News
J
Java Code Geeks
T
Tenable Blog
K
Kaspersky official blog
AWS News Blog
AWS News Blog
S
Security @ Cisco Blogs
The GitHub Blog
The GitHub Blog
T
Threatpost
月光博客
月光博客
H
Heimdal Security Blog
Security Latest
Security Latest
The Hacker News
The Hacker News
Y
Y Combinator Blog
A
Arctic Wolf
Apple Machine Learning Research
Apple Machine Learning Research
C
Cisco Blogs
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
Hugging Face - Blog
Hugging Face - Blog
T
The Blog of Author Tim Ferriss
C
CERT Recently Published Vulnerability Notes
D
Docker
Google Online Security Blog
Google Online Security Blog
D
DataBreaches.Net
V
Visual Studio Blog
H
Help Net Security

博客园 - 雨V幕

使用chromedp 来做人工模拟操作爬取数据方法 遍历redis按照前缀给未设置过期时间的数据添加过期时间 使用rabbitmq 进行任务调度 使用trace进行排查网络瓶颈 使用vscode 调试 Python 使用power shell 拆分 csv文件 将大文件拆分成小文件。 使用postman 添加预处理验签。 go 使用pprof 进行问题排查 Mysql无主键删除重复数据的快速方法 解决mysql 事务死锁的方法 go在处理批量下载时候出现fatal error: runtime: out of memory AnalyticDB 创建db go 序列化反序列化之后时区信息丢失 kraots2.0 在windows 环境搭建开发环境 Sql Server使用函数获取拼音码 关于async 和await关键字 使用kubespray 一键部署 containerd 的安装和熟悉 VMware 配置双网卡实现上网和固定ip
clickhouse 进行建表期间的一些优化
雨V幕 · 2024-02-26 · via 博客园 - 雨V幕
  • clickhouse 优化 :
    批量插入次数 设置 10000 - 15000 小批量频繁插入,每次插入都会产生一个part。所以clickhouse的写入,是提倡大批次插入的。(五个字段一万条数据大概在1~2M左右)
    -- partition by date_time 设置partition
    PARTITION BY toYYYYMMDD(event_date) 按天分区
    SETTINGS index_granularity = 8192 设置稀松索引 默认 8192 不同于mysql 的行索引。 8192 行才对应一个索引

RENAME TABLE member_view_records TO member_view_records_bak ;

CREATE TABLE member_view_records
(
    `saas_id` String COMMENT '用户id',

    `parent_id` UInt32 COMMENT '剧id',

    `title` String COMMENT '剧集标题',

    `sub_id` UInt32 COMMENT '剧集id',

    `num` UInt32 COMMENT '当前剧集集数',

    `create_time` DateTime COMMENT '记录创建时间'
)
ENGINE = MergeTree
ORDER BY (saas_id, create_time)
PARTITION BY toYYYYMMDD(create_time)
SETTINGS index_granularity = 10000   
COMMENT '用户观看记录';

ALTER TABLE member_view_records MODIFY TTL create_time + INTERVAL 14 DAY;


-- 回滚
RENAME TABLE member_view_records TO member_view_records_bak  ;

ALTER TABLE member_view_records Add INDEX idx_saas_id saas_id TYPE minmax GRANULARITY 1;

 参考自:https://zhuanlan.zhihu.com/p/667086347