1 Star 0 Fork 1

yysf/dplog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DDL.sql 1.05 KB
一键复制 编辑 原始数据 按行查看 历史
yangshaofeng 提交于 2023-08-23 19:04 . 添加spanId字段
drop table if exists fx.app_dev_log;
drop table if exists fx.app_dev_log_buffer;
create table if not exists fx.app_dev_log
(
`Time` DateTime64(3, 'Asia/Shanghai'),
`Level` LowCardinality(String),
`Thread` LowCardinality(String),
`AppName` LowCardinality(String),
`TraceID` FixedString(16),
`SpanID` FixedString(16),
`Logger` LowCardinality(String),
`Method` LowCardinality(String),
`_raw_log_` String CODEC (ZSTD),
`ipaddr` LowCardinality(String),
INDEX idx_rawLog `_raw_log_` TYPE tokenbf_v1(32768, 3, 0) GRANULARITY 1,
INDEX idx_trace_id TraceID TYPE bloom_filter GRANULARITY 1,
INDEX idx_span_id SpanID TYPE bloom_filter GRANULARITY 1
)
ENGINE = MergeTree
PARTITION BY toYYYYMMDD(Time)
order by (AppName, Time)
ttl toDateTime(Time) + toIntervalDay(7)
;
-- Buffer(database, table, num_layers, min_time, max_time, min_rows, max_rows, min_bytes, max_bytes)
CREATE TABLE fx.app_dev_log_buffer AS fx.app_dev_log
ENGINE = Buffer(fx, app_dev_log, 16, 60, 900, 8192, 16384, 5000000, 50000000);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/yysf_xin/dplog.git
[email protected]:yysf_xin/dplog.git
yysf_xin
dplog
dplog
master

搜索帮助