Skip to content

Commit 54d96ef

Browse files
committed
Do not return pointers from windowing functions
Commit c2f322e introduced large regressions since due to two changes: * Changed return values of windowing functions from float64 to *float64, causing excessive allocations. * Added an expensive check on the hot path for a condition that could be calculated once for the entire query. This commit reverts that changes and adds a better way to handle cases where both float and histogram values are missing, but there is no error in the evaluation. Signed-off-by: Filip Petkovski <[email protected]>
1 parent 9405e06 commit 54d96ef

File tree

5 files changed

+127
-157
lines changed

5 files changed

+127
-157
lines changed

execution/scan/subquery.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ func (o *subqueryOperator) Next(ctx context.Context) ([]model.StepVector, error)
201201
if ok {
202202
if h != nil {
203203
sv.AppendHistogram(o.pool, uint64(sampleId), h)
204-
} else if f != nil {
205-
sv.AppendSample(o.pool, uint64(sampleId), *f)
204+
} else {
205+
sv.AppendSample(o.pool, uint64(sampleId), f)
206206
}
207207
}
208208
o.IncrementSamplesAtTimestamp(rangeSamples.Len(), sv.T)

0 commit comments

Comments
 (0)