Clickhouse 使用DBeaver连接

运行环境:
windows 10
JDK 8.0.x
DBeaver 7.1.0
clickhouse 20.4.4.8

概述:

1.连接:

Clickhouse 使用DBeaver连接_第1张图片

2.设置驱动:

 

Clickhouse 使用DBeaver连接_第2张图片

版本查询:

https://mvnrepository.com/artifact/ru.yandex.clickhouse/clickhouse-jdbc

Clickhouse 使用DBeaver连接_第3张图片

驱动设置好之后需要下载,会使用Maven自动下载依赖的jar包,相关的依赖下载需要保持网络的畅通,下载需要等待一段时间

Clickhouse 使用DBeaver连接_第4张图片

3.测试连接:

Clickhouse 使用DBeaver连接_第5张图片

 

4.登陆测试SQL:

 Clickhouse 使用DBeaver连接_第6张图片

Clickhouse中总的大小:
select
    sum(rows) as "rows",
    formatReadableSize(sum(data_uncompressed_bytes)) as "data_size",
    formatReadableSize(sum(data_compressed_bytes)) as "compress_size",
    round(sum(data_compressed_bytes) / sum(data_uncompressed_bytes), 4) "compress_ratio"
from system.parts;

查询某个表的行数,大小,压缩比:

select
   p.`table` ,
    sum(rows) as "rows",
    formatReadableSize(sum(data_uncompressed_bytes)) as "data_size",
    formatReadableSize(sum(data_compressed_bytes)) as "compress_size",
    round(sum(data_compressed_bytes) / sum(data_uncompressed_bytes), 4) "compress_ratio"
from system.parts p
where table in('ontime')        
group by p.table;

 

 

你可能感兴趣的:(Clickhouse)