Flux performance issues when querying metadata

Hi there,

I have been using regular Influx interface before and now I am trying to switch to Flux.
To me it seems like some queries that were relatively simple and fast in Influx became pretty complicated (small problem) and veeery slow (big problem) in Flux.

Example:
show measurements
In Influx worked very fast (I assume the measurements were stored in some metadata file)

In Flux I replaced this with:
from(bucket:“test/autogen”)
|> range($range)
|> limit(n:1)
|> drop(columns: ["_value", “_field”])
|> group(columns: ["_measurement"], mode:“by”)
|> distinct(column:"_measurement")
|> group()

as explained in:

Still this solution takes almost 10 sec (yes, my data is very large…) which is actually a problem when integrating in Grafana (and waiting for measurements drop-down to unfold).

To me it appears as the query is basically creating a lot of tables with _value _filed pairs, and doing a lot of processing to rearange those. I am wondering if I am missing some other simple solution or is this per design? Also would it be possible, to add some queries working on metadata, as in Influx, to achieve same Performance with this types of queries?

Thanks a lot and all the best.

Hello @Aga-Schwarz,
Thanks for your question. Your query looks good to me. As for performance considerations, please know that it will be our priority when it hits beta.

@Aga-Schwarz Try using the v1.measurements() function. To use it, you need to import the influxdata/influxdb/v1 package. The functions in this package are designed to pull metadata from InfluxDB without having to extract it out of queried data.

import "influxdata/influxdb/v1"

v1.measurements(bucket: "telegraf/autogen")