Commit Graph

28 Commits (d11bc6182ccb481f410f877cd6dc818ddc72ad3f)

Author SHA1 Message Date
Jonathan A. Sternberg d11bc6182c Improve mean accuracy while retaining the speedup with a custom iterator
Fixes #5852.
2016-03-02 14:48:11 -05:00
Ben Johnson 0dda9f6608 add remote execution
This commit adds remote execution to the query engine.
2016-02-25 08:41:20 -07:00
Jonathan A. Sternberg e58f66845c Merge pull request #5658 from influxdata/js-mean-iterator
Optimize the mean() call by moving the calculation into the shard iterator
2016-02-18 17:27:46 -05:00
Ben Johnson f7e04abef7 remove NaN from query engine
This commit removes `math.NaN` returns from float iterators.
2016-02-17 14:11:31 -07:00
Jonathan A. Sternberg 18c7c554ba Optimize the mean() call by moving the calculation into the shard iterator
A new attribute has been added to points to track how many points were
used to calculate that point. This is particularly useful for finding
the mean as we can then split mean calculation into two phases: one at
the shard level and a second at the shards level.

This optimization is now used so we don't have to hold so many points in
memory while calculating the mean.
2016-02-16 10:32:34 -05:00
Jonathan A. Sternberg 73ee204fbc Cast number fill values for the fill iterator
Querying an integer field with a fill value will cause a cast error
because the underlying type is a float64 rather than an int64. Add a
function that will coerce the value to the correct type.

It may be more appropriate in the future to have the fill iterator read
the underlying iterator and cast to the appropriate type rather than
coerce the fill value to the correct type, but this solution works for
our current scenario well.
2016-02-11 15:21:50 -05:00
Jonathan A. Sternberg 98810a363a Correct the AuxIterator test and adding some additional locks
The additional locks shouldn't be necessary due to how the code is used,
but should prevent any potential data races in case we accidentally do
something bad.
2016-02-10 09:40:31 -07:00
Jonathan A. Sternberg ed151598ff Modify the AuxIterator to include a Start method
The AuxIterator streams points to the underlying iterators. When it
started automatically, race conditions occurred between the stream
closing the iterators and creating iterators from the AuxIterator.
2016-02-10 09:40:30 -07:00
Ben Johnson b3d5aa82b7 improve performance of LIMIT with no dimensions 2016-02-10 09:40:30 -07:00
Jonathan A. Sternberg 5c9cdd05c2 Modify the fill iterator to not produce empty name/tags for a time range
If a name/tag combination does not have any points in the time range at
all, fill will not generate points for it.
2016-02-10 09:40:30 -07:00
Jonathan A. Sternberg d1f7c445e7 Modify iterators to work across shards
Aux iterators now ask the iterator creator what series will be returned
and determine which aux fields to create based on the results.

The `tsdb.Shards` struct also creates a call iterator around the
iterators returned from each shard.
2016-02-10 09:40:29 -07:00
Jonathan A. Sternberg c2d1206177 Implement the fill iterator
Fill requires an additional function for IteratorCreator to retrieve the
series that will be returned from the iterator. When fill is required
for an aggregate, the IteratorCreator will be asked what series will be
returned by the created iterator.
2016-02-10 09:40:29 -07:00
Ben Johnson 627cd9d486 add dedupe iterator 2016-02-10 09:40:29 -07:00
Jonathan A. Sternberg 21d2a4c3de Sort MergeIterator by tags after name and before the window 2016-02-10 09:40:28 -07:00
Jonathan A. Sternberg 86cec8cea5 Fix reduce slice iterators to also separate by name 2016-02-10 09:40:28 -07:00
Jonathan A. Sternberg d8337acf90 Emit all points of a certain name for MergeIterators
When multiple sources are used, emit all points for a certain source
(like cpu) before another source (like mem) regardless of which window
they are in. If the sources are the same, then sort by window.

Continue to ignore tags since we don't need to sort nicely by tags with
a MergeIterator, only SortedMergeIterator.
2016-02-10 09:40:28 -07:00
Jonathan A. Sternberg c602503c7c Fix reduce iterators to separate by name
Previously reduce iterators just separated points by tags. If you had
identical tags but different names, it would group those together so you
could have these two points:

    cpu value=1
    mem value=2

When you performed a `mean(value)` call and included both cpu and mem as
sources, it would return one mem series with a value of 1.5 instead of
two serieses.
2016-02-10 09:40:28 -07:00
Jonathan A. Sternberg 5605bbb22e Implement casting support for different iterator types
Out of a list of iterators, an overarching iterator type is chosen and
only iterators of that type are returned for the merge iterator. If a
type can be cast to another type, an extra cast iterator is created to
handle that casting.

The only supported cast is from integers to floats.
2016-02-10 09:40:28 -07:00
Ben Johnson b4cb770a7f refactor aux iterators 2016-02-10 09:40:27 -07:00
Jonathan A. Sternberg 8e925065a0 Remove the join iterator since it is no longer used 2016-02-10 09:40:27 -07:00
Jonathan A. Sternberg 76b49b3ab3 Fixed a bug in first() and last() where the time was lost
last() would always return the last output of the iterator (which isn't
necessarily the last time value due to how the merge iterator works) and
first() would always return the first output of the iterator (wrong for
the same reason).

Now the time is kept by the reduce function and the times are wiped as
part of the reduce iterator after the value has been found.
2016-02-10 09:40:26 -07:00
Jonathan A. Sternberg 67c1042435 More work 2016-02-10 09:40:26 -07:00
Jonathan A. Sternberg 0e1910cb92 More work on improving the iterator unit tests 2016-02-10 09:40:26 -07:00
Ben Johnson b8918a780c integer support 2016-02-10 09:40:25 -07:00
Ben Johnson 00806de9b8 refactor query engine 2016-02-10 09:40:25 -07:00
Ben Johnson 0ad9c31169 simple derivative 2016-02-10 09:40:24 -07:00
Ben Johnson 60b051ee88 LIMIT/OFFSET 2016-02-10 09:40:24 -07:00
Ben Johnson cde973f409 refactor query engine 2016-02-10 09:40:24 -07:00