Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.3k views
in Technique[技术] by (71.8m points)

dolphindb怎么看一个表一共占用了多少磁盘空间?

我创建一个表,并写入了数据库,代码如下:

db=database("dfs://db1",VALUE,1 2 3)
timestamp = [09:34:07,09:36:42,09:36:51,09:36:59,09:32:47,09:35:26,09:34:16,09:34:26,09:38:12]
sym = `C`MS`MS`MS`IBM`IBM`C`C`C
price= 49.6 29.46 29.52 30.02 174.97 175.23 50.76 50.32 51.29                        
qty = 2200 1900 2100 3200 6800 5400 1300 2500 8800                                
t = table(timestamp, sym, qty, price)
dt=db.createTable(t,`dt).append!(t)

怎么看这个表dt一共占用了多少磁盘空间?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

DolphinDB中的getTabletsMeta函数可以查询分区表的磁盘空间占用情况。
上述情况,可以使用下面的代码查询,返回的大小单位是Byte:

select sum(diskUsage) from pnodeRun(getTabletsMeta{chunkPath="%", tableName="dt", diskUsage=true})  

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...