From 48e39068bdf699501d304d26305a767e87a16c34 Mon Sep 17 00:00:00 2001 From: Tom Wilkie Date: Thu, 25 Jan 2018 11:11:55 +0000 Subject: [PATCH] Don't allocate a mergeSeries if there is only one series to merge. --- storage/fanout.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/storage/fanout.go b/storage/fanout.go index ae74ad2ca..dd33999eb 100644 --- a/storage/fanout.go +++ b/storage/fanout.go @@ -340,6 +340,9 @@ func (c *mergeSeriesSet) Next() bool { } func (c *mergeSeriesSet) At() Series { + if len(c.currentSets) == 1 { + return c.currentSets[0].At() + } series := []Series{} for _, seriesSet := range c.currentSets { series = append(series, seriesSet.At())