mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-31 15:06:26 +00:00
wip
This commit is contained in:
parent
1d209f9168
commit
bdf1983bdc
1 changed files with 14 additions and 3 deletions
|
@ -190,17 +190,23 @@ func (shard *pipeSortProcessorShard) writeBlock(br *blockResult) {
|
||||||
rc.addValue(bytesutil.ToUnsafeString(bb.B))
|
rc.addValue(bytesutil.ToUnsafeString(bb.B))
|
||||||
}
|
}
|
||||||
bbPool.Put(bb)
|
bbPool.Put(bb)
|
||||||
|
|
||||||
|
i64Values := make([]int64, len(br.timestamps))
|
||||||
|
f64Values := make([]float64, len(br.timestamps))
|
||||||
|
for i := range f64Values {
|
||||||
|
f64Values[i] = nan
|
||||||
|
}
|
||||||
byColumns := []sortBlockByColumn{
|
byColumns := []sortBlockByColumn{
|
||||||
{
|
{
|
||||||
c: &blockResultColumn{
|
c: &blockResultColumn{
|
||||||
valueType: valueTypeString,
|
valueType: valueTypeString,
|
||||||
encodedValues: rc.values,
|
encodedValues: rc.values,
|
||||||
},
|
},
|
||||||
i64Values: make([]int64, len(br.timestamps)),
|
i64Values: i64Values,
|
||||||
f64Values: make([]float64, len(br.timestamps)),
|
f64Values: f64Values,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
shard.stateSizeBudget -= int(unsafe.Sizeof(byColumns[0]) + unsafe.Sizeof(*byColumns[0].c))
|
shard.stateSizeBudget -= len(rc.buf) + int(unsafe.Sizeof(byColumns[0])+unsafe.Sizeof(*byColumns[0].c))
|
||||||
|
|
||||||
// Append br to shard.blocks.
|
// Append br to shard.blocks.
|
||||||
shard.blocks = append(shard.blocks, sortBlock{
|
shard.blocks = append(shard.blocks, sortBlock{
|
||||||
|
@ -571,6 +577,11 @@ func sortBlockLess(shardA *pipeSortProcessorShard, rowIdxA int, shardB *pipeSort
|
||||||
|
|
||||||
if cA.c.isConst && cB.c.isConst {
|
if cA.c.isConst && cB.c.isConst {
|
||||||
// Fast path - compare const values
|
// Fast path - compare const values
|
||||||
|
ccA := cA.c.encodedValues[0]
|
||||||
|
ccB := cB.c.encodedValues[0]
|
||||||
|
if ccA == ccB {
|
||||||
|
continue
|
||||||
|
}
|
||||||
return cA.c.encodedValues[0] < cB.c.encodedValues[0]
|
return cA.c.encodedValues[0] < cB.c.encodedValues[0]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue