-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate the limit option to the low level iterators
When a GROUP BY or multiple sources are used, the top level limit iterator requires reading the entire iterator stream so it can find all of the tag groups it needs to return. For large data series, this ends up with the limit iterator discarding a lot of output. This change adds a new lower level limit iterator on each series itself so that there are fewer data points that have to be thrown away by the top level iterator. Fixes #5553.
- Loading branch information
1 parent
6f5c72e
commit bd5fdd7
Showing
6 changed files
with
269 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package tsm1 | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/influxdata/influxdb/influxql" | ||
) | ||
|
||
func newLimitIterator(input influxql.Iterator, opt influxql.IteratorOptions) influxql.Iterator { | ||
switch input := input.(type) { | ||
case influxql.FloatIterator: | ||
return newFloatLimitIterator(input, opt) | ||
case influxql.IntegerIterator: | ||
return newIntegerLimitIterator(input, opt) | ||
case influxql.StringIterator: | ||
return newStringLimitIterator(input, opt) | ||
case influxql.BooleanIterator: | ||
return newBooleanLimitIterator(input, opt) | ||
default: | ||
panic(fmt.Sprintf("unsupported limit iterator type: %T", input)) | ||
} | ||
} |