实验准备

  • 内存分配4G

  • 对 1 个设备的 100 个时间序列进行写入

  • 连续写入,每隔10s更改空值比例,记录写入的点数

  • 三个被测试方法

    • insertTablet(drop null when inserting):在insertTablet过程中舍弃空值

    • insertTablet(store null with bitmap):在insertTablet过程中保留空值,使用BitMap标记空值,在刷盘时舍弃

    • insertRecordsInOneDevice:在insertRecordsInOneDevice前就舍弃空值(由客户端判断)

实验结果

空值比例逐渐增长



0.00.10.20.30.40.50.60.70.80.9
insertTablet(drop null when inserting)80950000708750006606400062520000593760006302000058412000531870003698400018023000
insertTablet(store null with bitmap)75850000660600006216000056749000519660004842500039868000352440002506800012737000
insertRecordsInOneDevice14790000166230001598400016681000162720001662500016832000158130001584800014572000

空值比例逐渐降低



0.90.80.70.60.50.40.30.20.10.0
insertTablet(drop null when inserting)19141000398580005708700068896000697400007269000072065000724500007770000081664000
insertTablet(store null with bitmap)11145000247440003286200047636000442400005048800050876000542700006662700077710000
insertRecordsInOneDevice12062000146460001451400014404000149300001439400015960000149440001440000014480000

实验结论

  • insertTablet(drop null when inserting) 版本的性能优于 insertTablet(store null with bitmap) 版本的性能

  • 随着空值的增加,insertTablet(drop null when inserting) 版本逐渐下降,在空值占比 60% ~ 70% 时出现大幅下降

  • insertTablet(drop null when inserting) 版本的写入性能优于 insertRecords 接口,所以即使存在大量空值,也建议用户使用 insertTablet接口


  • No labels