diff --git a/lib/logstorage/pipe_sort.go b/lib/logstorage/pipe_sort.go index 783c638e8..aee2028cf 100644 --- a/lib/logstorage/pipe_sort.go +++ b/lib/logstorage/pipe_sort.go @@ -583,7 +583,10 @@ func sortBlockLess(shardA *pipeSortProcessorShard, rowIdxA int, shardB *pipeSort if ccA == ccB { continue } - return cA.c.encodedValues[0] < cB.c.encodedValues[0] + if isDesc { + return ccB < ccA + } + return ccA < ccB } if cA.c.isTime && cB.c.isTime {