# Continuous Query Problem

**URL:** <https://community.influxdata.com/t/continuous-query-problem/1342>\
**Category:** Store\
**Created:** [June 16, 2017, 7:11pm UTC](https://community.influxdata.com/t/continuous-query-problem/1342 "2017-06-16T19:11:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ferztyle](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@ferztyle](https://community.influxdata.com/u/ferztyle)\
**Post date:** [June 16, 2017, 7:11pm UTC](https://community.influxdata.com/t/continuous-query-problem/1342/1 "2017-06-16T19:11:06Z")

</div>

Hello everyone!, I have a telegraf/influxdb/grafana configuration and all the raw data received from telegraf is stored in a database called db1. I created a continuous query to write downsampled data (one point every 10 minutes) in other database (db2), my CQ is like this:

CREATE CONTINUOUS QUERY “cq\_10min” ON “db1” BEGIN SELECT mean( \* ) INTO db2.autogen.:MEASUREMENT FROM /._/ GROUP BY time(10m),_ END

All the MEASUREMENT names are called the same that in db1, but the field names has changed. For example:  
In the measurement cpu, what in db1 is called usage\_idle, in db2 now is called mean\_usage\_idle.

Is there any way to remain the same field names? This is a problem for me since a want to create grafana templates that will allow me to change between databases.  
What could be other solution for this kind of issues?

Thanks in advance!

Fer Rios

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 19, 2017, 4:44pm UTC](https://community.influxdata.com/t/continuous-query-problem/1342/2 "2017-06-19T16:44:25Z")

</div>

@ferztyle That is not possible currently. I would advise not downsampling. Are you running into performance issues? How many hosts are you monitoring?

---

<div class="post-metadata">

**Author:** ![ferztyle](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@ferztyle](https://community.influxdata.com/u/ferztyle)\
**Post date:** [June 24, 2017, 4:00pm UTC](https://community.influxdata.com/t/continuous-query-problem/1342/3 "2017-06-24T16:00:47Z")

</div>

Hi, sorry for the delay!. Currently i have like 50 hosts monitored, and the goal is to put 100 more. We make use of many telegraf input plugins like jolokia, apache, haproxy, sqlserver, win\_perf, processes, postgresql, snmp, etc, and those plugins comes with tons of data!. I’m interested on the downsampling part because i want to be able to perform queries from the grafana on this measurements to retrieve the oldest data ( like now() - 1 year ago).

If I had exactly the same names as the original measurement, i would be able to perform queries from the grafana much more easily.

PD: I found the same problem here too!: [Unable to copy field names after aggregation · Issue #8524 · influxdata/influxdb · GitHub](https://github.com/influxdata/influxdb/issues/8524)

Fer Rios

---

<div class="post-metadata">

**Author:** ![jackzampolin](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jackzampolin/32/5_2.png) [@jackzampolin](https://community.influxdata.com/u/jackzampolin)\
**Post date:** [June 26, 2017, 4:21pm UTC](https://community.influxdata.com/t/continuous-query-problem/1342/4 "2017-06-26T16:21:35Z")

</div>

@ferztyle This is an issue we are very aware of and plan to fix in upcoming releases. It is decidedly non trivial however. My advice would be to pick the queries that you need to downsample for the long term analysis and leave the rest of the data undownsampled.

---

<div class="post-metadata">

**Author:** ![ferztyle](https://avatars.discourse-cdn.com/v4/letter/f/df788c/32.png) [@ferztyle](https://community.influxdata.com/u/ferztyle)\
**Post date:** [June 27, 2017, 9:46pm UTC](https://community.influxdata.com/t/continuous-query-problem/1342/5 "2017-06-27T21:46:35Z")

</div>

Ok @jackzampolin , thanks for your help.
