juttle / juttle-opentsdb-adapter

Apache License 2.0
1 stars 2 forks source link

Is it possible to optimize `sort`, `head` and `tail`? #21

Open dmehra opened 8 years ago

dmehra commented 8 years ago

Offhand I did not locate either sorting, or a limit option in OpenTSDB, but I only briefly glanced. If we can optimize sort, head and tail procs, let's do it...

VladVega commented 8 years ago
  1. sort: The data should always be sorted by time. Use case for sorting by another field when you have time-series data?
  2. head and tail...seems like opentsdb doesn't support those kinds of optimizations. They support downsampling though: http://opentsdb.net/docs/build/html/user_guide/query/index.html
philrz commented 8 years ago

RE: A use case for sorting time-series data by something other than time. It's rare, but it can come up. For instance, I once was taking granular measurements of CPU of a device at a regular interval. As we know, downsampling a large number of values like that can yield a different result based on whether one takes the mean, the median, or something else. To illustrate this, I was sorting the points by value and then charting them, showing when the values created a "long tail" or other distribution curve.

Anyway, I don't say that to claim it should be a high priority, but just letting you know it exists.