-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit series count in selection #6102
Conversation
/cc @jwilder @jsternberg |
@@ -463,6 +466,12 @@ func (e *QueryExecutor) executeSelectStatement(stmt *influxql.SelectStatement, c | |||
em.OmitTime = stmt.OmitTime | |||
defer em.Close() | |||
|
|||
// Calculate initial stats across all iterators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be before creating the emitter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The emitter is handling the closing of the iterators so I didn't want to do a double defer close. Really, the iterators should close themselves but that's a change for a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course. Never mind.
I originally added the limit to This PR is a WIP because I need to know how we want to specify this parameter. I can think of two ways:
|
0ece1f9
to
50e8856
Compare
Limit added to server configuration. |
This commit adds a buffer for stats to be updated without requiring a mutex lock/unlock on every point. The tradeoff is that stats are not exactly precise. This works for our use case because stats are only periodically checked.
This commit adds a configurable limit to the number of series that can be returned from a `SELECT` statement. The limit is checked immediately after planning and is determined by the use of iterator stats. Fixes influxdata#6076
50e8856
to
a6d9930
Compare
Overview
This pull request adds a configurable limit to the number of series that can be returned from a
SELECT
statement. The limit is checked immediately after planning and is determined by the use of iterator stats.Fixes #6076