2
votes

We are using influx DB. Basically I wish to store my data for one year total so I created a default RETENTION POLICY fro 365d.

I also want to create downsampling. I store my event every second, but I dont need them in seconds resolution for more than 3 months. basically, after 3 monthes I prefer to SUM the data in days and after 6 months I prefer to sum the data in weeks resolution.

I understood from this doc that I can downsample using "continues queries".

What I also understood that I have to downsample to another table. This will make my query process much harder because I will have to decide which table should I query and maybe combine the data of several tables.

Can I somehow create Downsampling process that will have all the data in the same table?

Regards, Ido

1
Anybody? Help me please? - Ido Barash
AFAIK, this is not possible. Querying from different retentions will have to be expressed in the queries. - Wrikken
Thanks. Do you have an example of how to do this? Join? Union? - Ido Barash
No, what I am saying is that your 2 requirements (a) have different retentions / sample rates between now and >3 months ago and (b) keeping queries agnostic of that fact is impossible. What I would do is just decide which retention / precision I want to use: if I query over the last half year, just use the retention with the 'days' , for the last day the 'second' precision retention policy, etc. Keep in mind that with proper downsampling, your 'days' and 'weeks' for recent data are filled as well. - Wrikken

1 Answers

2
votes

To summarize the comments on this question: with Influxdb, you can not have multiple retention policies within a single table. You will have to query across multiple retention policies. You might want to Subscribe to this Github feature request for Intelligent Rollups and Querying of Aggregated Data