influxdb/query
Jonathan A. Sternberg 9e122eb1a4 Fix the implicit time range in a subquery
The implicit time range for an interval is supposed to be now when no
end is specified. In a subquery though, the interval doesn't exist and
so it doesn't set the end time to now, but to the max time. Since the
subquery qualifies as something that should have the implicit end time
apply, this results in a query that runs slowly because it is filling in
a bunch of unasked for intervals if a fill is specified.

This hack adds the implicit end time if it sees the parent query's end
time is set to the maximum available time.

This is a temporary fix for this problem. The query compilation should
perform these time range calculations in the compilation stage and the
subqueries should use the compilation stage during execution instead of
ignoring it. That work takes a lot more effort though and is more prone
to running into unforeseen bugs.

This fix introduces a subtle, but likely rare to run into bug. If the
top level query specifies the maximum time as the end time and the
subquery has an interval, the subquery should use the end time rather
than now as the time range. With this hack, it will interpret it as an
implicit time rather than an explicit one. This is unlikely to matter
though.
2018-02-27 17:10:10 -06:00
..
internal Cleanup query package 2018-01-21 12:08:23 -08:00
neldermead move RewriteStatement and neldermead to influxdb/query package 2017-10-30 10:24:15 -07:00
call_iterator.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
call_iterator_test.go Cleanup query package 2018-01-21 12:08:23 -08:00
cast.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
compile.go Fix the implicit time range in a subquery 2018-02-27 17:10:10 -06:00
compile_test.go Fix regression when math between literals is used in a field 2018-02-14 14:34:34 -05:00
emitter.go Use index for SHOW X meta queries 2017-11-06 19:15:00 +00:00
emitter_test.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
explain.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
functions.gen.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
functions.gen.go.tmpl Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
functions.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
functions_test.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
iterator.gen.go Cleanup query package 2018-01-21 12:08:23 -08:00
iterator.gen.go.tmpl Cleanup query package 2018-01-21 12:08:23 -08:00
iterator.go Fix the implicit time range in a subquery 2018-02-27 17:10:10 -06:00
iterator_mapper.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
iterator_mapper_test.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
iterator_test.go Cleanup query package 2018-01-21 12:08:23 -08:00
linear.go Add unsigned iterators for all types 2017-09-18 15:09:10 -05:00
monitor.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
point.gen.go EXPLAIN ANALYZE 2017-10-20 08:01:37 -07:00
point.gen.go.tmpl EXPLAIN ANALYZE 2017-10-20 08:01:37 -07:00
point.go Update influxql so DataType constants are the type DataType 2017-11-07 18:34:53 -06:00
point_test.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
query.go Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00
query_executor.go Update sample config with information on logging levels 2018-02-21 11:25:38 -06:00
query_executor_test.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
result.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
select.go Fix the implicit time range in a subquery 2018-02-27 17:10:10 -06:00
select_test.go influxdata/influxdb/influxql -> influxdata/influxql 2017-10-30 14:40:26 -07:00
statement_rewriter.go Improve SHOW TAG KEYS performance. 2017-11-07 10:59:19 -07:00
statement_rewriter_test.go Improve SHOW TAG KEYS performance. 2017-11-07 10:59:19 -07:00
subquery.go Fix the implicit time range in a subquery 2018-02-27 17:10:10 -06:00
task_manager.go Update the zap logger dependency 2017-11-10 16:27:16 -06:00
tmpldata Separate the query engine into a separate package 2017-08-16 13:38:43 -05:00