Commit Graph

78 Commits (19feed1d130adf28fb27fc264e90a7abf5e0f46e)

Author SHA1 Message Date
liang@qiniu.com c13f8e9128 Fix wrong results of distributed aggregative query 2015-12-08 07:08:46 +08:00
Ben Johnson 28b585e639 refactor tsdb query engine
This commit refactors the tsdb query engine to use separate aggregate
and raw execution paths, encapsulates cursor functionality, and removes
the TagSetCursor from the aggregate path. By removing the TagSetCursor,
we can pass sets of unordered values to the map functions and bypass
the `container/heap` entirely.
2015-10-22 09:41:12 -06:00
Ben Johnson 343dd23ee7 refactor map functions to use list of values
This commit changes `tsdb.mapFunc` to use `tsdb.MapInput` instead
of an iterator. This will make it easier and faster to pass blocks
of values from the new storage engine into the engine.
2015-09-29 14:00:33 -06:00
Cory LaNou d6ee542083 SelectFilterFields -> SelectWhereFields 2015-09-23 15:47:12 -05:00
Cory LaNou 6b19e3dd9c minor refactorings 2015-09-23 09:47:24 -05:00
Cory LaNou 78bc740434 full support for min/max/first/last 2015-09-23 09:03:57 -05:00
Ben Johnson 96715d7d90 rename Cursor.Seek() to Cursor.SeekTo() 2015-09-22 13:23:16 -06:00
Ben Johnson 56cb2fae5d fix integration tests 2015-09-22 13:10:13 -06:00
Ben Johnson 649663ca15 fix tests 2015-09-22 13:10:13 -06:00
Ben Johnson b213ddad78 refactor cursor 2015-09-22 13:10:12 -06:00
Ben Johnson a5269e9cc7 rename direction to ascending. 2015-09-22 13:09:26 -06:00
Ben Johnson 1b8b625787 refactor SelectMapper 2015-09-22 13:09:26 -06:00
Ben Johnson 0883182798 simplify select mapper stmt 2015-09-22 12:27:14 -06:00
Philip O'Toole d96119cc01 Correct MapperValueAsJSON comment
[ci skip]
2015-09-22 09:49:57 -07:00
Philip O'Toole 56193be05c Simple tests work 2015-09-21 22:50:29 -07:00
Daniel Morsing eb65f50593 gofmt 2015-09-11 14:41:59 +00:00
Daniel Morsing ab9ae468ca unexport some functions
For good measure basically. Not needed for correctness, but it keeps
people from using these.
2015-09-11 14:39:09 +00:00
Daniel Morsing 66fc270d1e Move aggregate funcs into tsdb
Pure move, No functional changes.
2015-09-11 14:27:47 +00:00
Cory LaNou 05f69b3d6c Validate Dimension for proper time scenarios. Fixes #3902 2015-09-10 13:10:21 -05:00
Cory LaNou 62e9c24b25 fixes #3926 2015-09-08 14:15:48 -05:00
Ben Johnson fd9be63b4e rollback bolt tx on mapper open error
This commit fixes `SelectMapper.Open()` so that it properly rolls back
transactions. Previously, this caused transactions to stay open
indefinitely which caused mmap resizes to hang indefinitely.
2015-09-08 10:28:51 -06:00
Cory LaNou b62d8c0515 expand variable names for clarity 2015-09-04 13:30:43 -05:00
Cory LaNou 65e652850a btf -> tmin 2015-09-04 13:30:42 -05:00
Cory LaNou 9ab3d89c06 bucketTime* -> tMin* 2015-09-04 13:30:42 -05:00
Cory LaNou 3ca93594c3 BucketTime -> TMin 2015-09-04 13:30:42 -05:00
Cory LaNou 347ffc70b4 wire up advanced top sorting/slicing 2015-09-04 13:30:41 -05:00
Cory LaNou 97f2dc830f comment/type fixes 2015-09-04 13:30:39 -05:00
Cory LaNou 72fd115dc2 exposing tags on cursors, top/bottom are valid funcs now 2015-09-04 13:30:39 -05:00
Jason Wilder e767feb8d9 Fix order by desc with aggregate function not return any values 2015-09-03 22:31:58 -06:00
Jason Wilder 5a6b0afc4b Replace cursor direction with a type 2015-09-03 22:31:48 -06:00
Jason Wilder 266bdc1c2b Support sort by time DESC in wal and bz1 engines 2015-09-03 22:28:36 -06:00
Daniel Morsing c4092d7fc3 Revert "move aggregate functions" 2015-09-02 10:47:58 -07:00
Daniel Morsing 34744b647d unexport some functions
For good measure basically. Not needed for correctness, but it keeps
people from using these.
2015-09-01 14:58:55 -07:00
Daniel Morsing 65340a023b Move aggregate funcs into tsdb
Pure move, No functional changes.
2015-09-01 14:25:59 -07:00
Jason Wilder f72fd247b5 Fix panic when querying against non-fully replicated shards
The TSDBStore was returning a nil mapper if the shard did not exist.  The caller always
assumed the mapper would not be nil causing a panic.  Instead, have the mapper skip the mapping
phase if it's shard reference is nil.  This fixes queries against data-only nodes and against
shards that are not fully replicated in the cluster.

Fixes #3574
2015-08-31 10:03:07 -06:00
Philip O'Toole cf58c38995 go fmt fixes 2015-08-27 18:20:41 -07:00
Daniel Morsing ca7a806e93 Only seek the cursor if it would yield a value of interest
If we've seeked a cursor, then we can be sure that there will be no
data between it and the point that was seeked to. Take advantage of
this fact to only seek when it would yield us a value that would be
different from the last.

In addition, only init the pointsheap when doing a raw query. For
aggregate queries, it is reinitialized on every time bucket, so no
need to seek through all the cursors

For a synthetic database where there was only entries for a tiny
slice of time, it cut queries from 112 seconds to 30 seconds doing
`select mean(value) from cpu where time > now - 2h group by time(1h)`
2015-08-27 10:57:18 -06:00
dgnorton 2cf6233cbc Merge pull request #3808 from influxdb/dmq-show-measurements2
convert SHOW MEASUREMENTS to a distributed query
2015-08-26 11:43:38 -04:00
Daniel Morsing 391d8cd8d7 reuse pointsheapItem
Since we already got a pointsHeapItem, let's just reuse it instead
of allocating a new one. This cuts allocated memory of a 1 million
points aggregate query from 4881.97MB to 4139.86MB
2015-08-25 17:07:34 -06:00
David Norton 88f556af72 convert SHOW MEASUREMENTS to a distributed query 2015-08-23 23:09:51 -04:00
David Norton 5d26cfa4d7 return interface{} from nextChunk* functions 2015-08-22 10:59:29 -04:00
David Norton c8f88f9a61 refactor remote mapping 2015-08-22 10:16:41 -04:00
Paul Dix 1c24cbd8a7 Fix query engine not goroutine safe issue. 2015-08-19 18:43:50 -04:00
Philip O'Toole 7e72a1a6b9 Precompute cursor keys
CPU profiling shows that computing the tagset-based key of each point is significant CPU cost. These keys actually don't change per cursor, so precompute once at mapper-open time, and then use those values as points are drained from the cursor.

Before this change the cursor tag was getting computed on every point, which involved marshalling tags.
2015-08-14 20:02:21 -07:00
Cory LaNou 4e04c069f9 error out if only tags are in the select clause 2015-08-14 15:24:37 -05:00
Cory LaNou 1f7f977c5e minor refactorings based on pr feedback 2015-08-14 15:05:26 -05:00
Cory LaNou 7fdb682966 first pass at raw queries with tags 2015-08-14 15:05:26 -05:00
Cory LaNou dc83c57d7e more wip 2015-08-14 15:05:26 -05:00
Cory LaNou 8ea3c47747 wip 2015-08-14 15:05:26 -05:00
David Norton d661bf1a06 fix #3414: shard mappers perform query re-writing 2015-08-04 09:49:50 -04:00