# Performance issues after migration from InfluxDB 1.8 to 2.7

**URL:** <https://community.influxdata.com/t/performance-issues-after-migration-from-influxdb-1-8-to-2-7/57193>\
**Category:** InfluxDB 2\
**Tags:** influxdb, influxql, flux\
**Created:** [May 7, 2025, 2:23pm UTC](https://community.influxdata.com/t/performance-issues-after-migration-from-influxdb-1-8-to-2-7/57193 "2025-05-07T14:23:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davide.avella](https://avatars.discourse-cdn.com/v4/letter/d/e56c9b/32.png) [@davide.avella](https://community.influxdata.com/u/davide.avella)\
**Post date:** [May 7, 2025, 2:23pm UTC](https://community.influxdata.com/t/performance-issues-after-migration-from-influxdb-1-8-to-2-7/57193/1 "2025-05-07T14:23:11Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [May 14, 2025, 10:22pm UTC](https://community.influxdata.com/t/performance-issues-after-migration-from-influxdb-1-8-to-2-7/57193/2 "2025-05-14T22:22:55Z")

</div>

Hello @davide.avella,  
If you’re grouping by measurement first, you can use last() instead and skip the second group. That should be an equivalent query. Hopefully a little faster too.
