Clickhouse 可以通过set 来设置参数值,通过show setting 来查看当前的值。 参数内容是保存在system.settings元数据表里面的。
system.settings表结构
列名 类型 说明
name String 参数名字
value String 参数值
changed UInt8 参数相对默认值,是否修改过
description String 参数的简短描述信息
min Nullable(String) 参数的最小值,如果没有则为null
max Nullable(String) 参数的最大值,如果没有则为null
readonly UInt8 参数是否只读,不可修改,0:可以修改,1:不可以修改
type String 参数分类,和字段基本类型对应,UInt31,UInt64,String之类的
支持的类型列表
localhost :) select distinct type from system.settings
SELECT DISTINCT type
FROM system.settings
Query id: 07ce6a1e-1280-4a14-aee5-6db5af39b74d
┌─type─────────────────────┐
│ UInt64 │
│ MaxThreads │
│ Seconds │
│ Milliseconds │
│ Bool │
│ LoadBalancing │
│ TotalsMode │
│ Float │
│ String │
│ Int64 │
│ LogQueriesType │
│ DistributedProductMode │
│ JoinStrictness │
│ OverflowMode │
│ OverflowModeGroupBy │
│ JoinAlgorithm │
│ LogsLevel │
│ DefaultDatabaseEngine │
│ MySQLDataTypesSupport │
│ DistributedDDLOutputMode │
│ UnionMode │
│ Char │
│ DateTimeInputFormat │
│ DateTimeOutputFormat │
│ URI │
└──────────────────────────┘
25 rows in set. Elapsed: 0.009 sec.
DESC输出
localhost :) desc system.settings ;
DESCRIBE TABLE system.settings
Query id: de9c3f5f-44f3-4713-b7bc-bfec1c6901e9
┌─name────────┬─type─────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ name │ String │ │ │ │ │ │
│ value │ String │ │ │ │ │ │
│ changed │ UInt8 │ │ │ │ │ │
│ description │ String │ │ │ │ │ │
│ min │ Nullable(String) │ │ │ │ │ │
│ max │ Nullable(String) │ │ │ │ │ │
│ readonly │ UInt8 │ │ │ │ │ │
│ type │ String │ │ │ │ │ │
└─────────────┴──────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
8 rows in set. Elapsed: 0.004 sec.
使用样例
localhost :) select * from system.settings limit 1\G
SELECT *
FROM system.settings
LIMIT 1
Query id: 419e76fc-2079-445b-ad45-e79099ccba66
Row 1:
──────
name: min_compress_block_size
value: 65536
changed: 0
description: The actual size of the block to compress, if the uncompressed data less than max_compress_block_size is no less than this value and no less than the volume of data for one mark.
min: ᴺᵁᴸᴸ
max: ᴺᵁᴸᴸ
readonly: 0
type: UInt64
1 rows in set. Elapsed: 0.004 sec.
localhost :)
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




