quickstart/tutorial/compaction-init-index.json
compaction-tutorial
bin/post-index-task --file quickstart/tutorial/compaction-init-index.json --url http://localhost:8081 Copy
注意
http://localhost:8888/unified-console.html#datasources
compaction-tutorial
51 Segments
COUNT(*)
dsql> select count(*) from "compaction-tutorial";
┌────────┐
│ EXPR$0 │
├────────┤
│ 39244 │
└────────┘
Retrieved 1 row in 1.38s.
quickstart/tutorial/compaction-keep-granularity.json
{
"type": "compact",
"dataSource": "compaction-tutorial",
"interval": "2015-09-12/2015-09-13",
"tuningConfig" : {
"type" : "index_parallel",
"maxRowsPerSegment" : 5000000,
"maxRowsInMemory" : 25000
}
}
2015-09-12/2015-09-13
compaction-tutorial
tuningConfig
bin/post-index-task --file quickstart/tutorial/compaction-keep-granularity.json --url http://localhost:8081
Segments
“未使用” 合并段
旧数据段集合 新合并集
新的合并段
compaction-tutorial
COUNT(*)
39244
dsql> select count(*) from "compaction-tutorial";
┌────────┐
│ EXPR$0 │
├────────┤
│ 39244 │
└────────┘
Retrieved 1 row in 1.30s.
24个数据分段
不同颗粒度
quickstart/tutorial/compaction-day-granularity.json
DAY
{
"type": "compact",
"dataSource": "compaction-tutorial",
"interval": "2015-09-12/2015-09-13",
"segmentGranularity": "DAY",
"tuningConfig" : {
"type" : "index_parallel",
"maxRowsPerSegment" : 5000000,
"maxRowsInMemory" : 25000,
"forceExtendableShardSpecs" : true
}
}
segmentGranularity
DAY
bin/post-index-task --file quickstart/tutorial/compaction-day-granularity.json --url http://localhost:8081