Hello,
through a specific procedure, I migrated data from an InfluxDB 1.8 instance deployed on a VM to an InfluxDB 2.7 instance deployed on AKS.
The database has very high cardinality. The data starts from 2023 and includes approximately 165K series. What mostly increases the cardinality are the measurements, which amount to around 10K.
The database is queried by an application that generates reports. The first thing the user selects is the measurement, pre-filtering two tags before composing the actual data query.
On version 1.8, this was done using the following query:
SHOW MEASUREMENTS WHERE tag1 == 'A' AND tag2 == 'B'.
The same query, which took just a few seconds on version 1.8, now takes about 40 seconds on version 2.7 using /query
endpoint. I also tried using the v2 endpoints api/v2/query
with a Flux query, but since a time range must be specified, the performance remains poor.
Below the Flux script:
from(bucket: "$BUCKET")
|> range(start: -30d)
|> filter(fn: (r) => r.tag1== "A" and r.tag2== "B")
|> group(columns: ["_measurement"], mode:"by")
|> distinct(column:"_measurement")
|> group()
Do you have any suggestions to help resolve this bottleneck?