Influxdb: Joining series

Created on 27 Aug 2015  路  7Comments  路  Source: influxdata/influxdb

Is there a way to join two time series together like you had in the v 0.8 documentation?https://influxdb.com/docs/v0.8/api/query_language.html

Most helpful comment

@beckettsean so if we have 2 separate series that we want to do math against we would have to feed those metrics into something and have it generate a third series and put that into influxdb? I'm thinking of metrics like total disk space, used disk space, and being able to calculate disk used % based off of those 2 series. Is the intent for us to feed 3 series into influxdb instead of calculating the third?

All 7 comments

All series in a given measurement are automatically merged unless explicitly filtered out by the WHERE clause.

There is no way to join series from two different measurements.

@beckettsean so if we have 2 separate series that we want to do math against we would have to feed those metrics into something and have it generate a third series and put that into influxdb? I'm thinking of metrics like total disk space, used disk space, and being able to calculate disk used % based off of those 2 series. Is the intent for us to feed 3 series into influxdb instead of calculating the third?

I believe it is intended that we would put free and used space as values in the same time series. A calculated column is not required.

@sstarcher what @esecules says is correct. Measurements are containers of many many series. Any series within a measurement can be trivially "merged" or queried together with any other series in that measurement.

So for total disk space: SELECT sum(value) FROM disk_space or whatever. For used disk space: SELECT SUM(value) FROM used_disk_space. In this scenario, it's not possible to calculate used_disk_space/total_disk_space because they are separate measurements.

If you have total disk and used disk as multiple fields in the same measurement, then you can do this: SELECT used_disk/total_disk AS disk_percent_full FROM disk. In this case, used_disk and total_disk are fields on the measurement disk, and each needs to be stored with every point.

@beckettsean Is this something that is likely to become available? In my mind I compare the Influx structure to that of a traditional relational database (granted this is wrong, but the query structure makes it so).

I kind of make the relation that measurements are tables and series are columns and because of this I have been structuring my data as such.

Now I want to be able to run cross measurement queries to display high level overviews of my data but it seems this isn't possible.

I guess there are some options:

  • Restructure my data (I am not sure this is possible now, due to the amount of data collected) so series I want to cross query are stored under the same measurement.
  • Create a third party agent to query the two measurements independently and store the result into a third measurement.
  • Wait until cross measurement queries become available (if they are planned to become available).

It would be nice to gather your thoughts on whether or not this should/will be possible in the future.

Is this something that is likely to become available?

Short-term, no. I think your best bet is to rework your schema to support the current functionality, or use a third party tool, although that's more of a bandaid than a long term fix.

I'm also affected by this issue. See also #3552.

For now, I will try to create the third party agent @Samuel1989 is talking about to query two measurements independently and store the result into a third measurement (a kind of continuous query system outside of InfluxDB to work around this issue).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dandv picture dandv  路  3Comments

davidgubler picture davidgubler  路  3Comments

756445638 picture 756445638  路  3Comments

allenbunny picture allenbunny  路  3Comments

MayukhSobo picture MayukhSobo  路  3Comments