This commit is contained in:
Aliaksandr Valialkin 2024-05-07 17:05:20 +02:00
parent b1df5ce183
commit 1225ed591b
No known key found for this signature in database
GPG key ID: 52C003EE2BCDB9EB
2 changed files with 7 additions and 2 deletions

View file

@ -534,6 +534,11 @@ func sortBlockLess(shardA *pipeSortProcessorShard, rowIdxA int, shardB *pipeSort
cB := &bB.byColumns[idx]
bf := byFields[idx]
if cA.c.isConst && cB.c.isConst {
// Fast path - compare const values
return cA.c.encodedValues[0] < cB.c.encodedValues[0]
}
if cA.c.isTime && cB.c.isTime {
// Fast path - sort by _time
tA := bA.br.timestamps[rrA.rowIdx]

View file

@ -189,8 +189,8 @@ func getEmptyStrings(rowsCount int) []string {
}
values := *p
if n := rowsCount - cap(values); n > 0 {
values = append(values[:cap(values)], make([]string, n)...)
emptyStrings.Store(&values)
valuesNew := append(values[:cap(values)], make([]string, n)...)
emptyStrings.Store(&valuesNew)
}
return values[:rowsCount]
}