THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
实验准备
内存分配4G
对 1 个设备的 100 个时间序列进行写入
连续写入,每隔10s更改空值比例,记录写入的点数
三个被测试方法
insertTablet(drop null when inserting):在insertTablet过程中舍弃空值
insertTablet(store null with bitmap):在insertTablet过程中保留空值,使用BitMap标记空值,在刷盘时舍弃
insertRecordsInOneDevice:在insertRecordsInOneDevice前就舍弃空值(由客户端判断)
实验结果
空值比例逐渐增长
0.0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | |
---|---|---|---|---|---|---|---|---|---|---|
insertTablet(drop null when inserting) | 80950000 | 70875000 | 66064000 | 62520000 | 59376000 | 63020000 | 58412000 | 53187000 | 36984000 | 18023000 |
insertTablet(store null with bitmap) | 75850000 | 66060000 | 62160000 | 56749000 | 51966000 | 48425000 | 39868000 | 35244000 | 25068000 | 12737000 |
insertRecordsInOneDevice | 14790000 | 16623000 | 15984000 | 16681000 | 16272000 | 16625000 | 16832000 | 15813000 | 15848000 | 14572000 |
空值比例逐渐降低
0.9 | 0.8 | 0.7 | 0.6 | 0.5 | 0.4 | 0.3 | 0.2 | 0.1 | 0.0 | |
---|---|---|---|---|---|---|---|---|---|---|
insertTablet(drop null when inserting) | 19141000 | 39858000 | 57087000 | 68896000 | 69740000 | 72690000 | 72065000 | 72450000 | 77700000 | 81664000 |
insertTablet(store null with bitmap) | 11145000 | 24744000 | 32862000 | 47636000 | 44240000 | 50488000 | 50876000 | 54270000 | 66627000 | 77710000 |
insertRecordsInOneDevice | 12062000 | 14646000 | 14514000 | 14404000 | 14930000 | 14394000 | 15960000 | 14944000 | 14400000 | 14480000 |
实验结论
insertTablet(drop null when inserting) 版本的性能优于 insertTablet(store null with bitmap) 版本的性能
随着空值的增加,insertTablet(drop null when inserting) 版本逐渐下降,在空值占比 60% ~ 70% 时出现大幅下降
insertTablet(drop null when inserting) 版本的写入性能优于 insertRecords 接口,所以即使存在大量空值,也建议用户使用 insertTablet接口