Influx 2.0.5 vs. 2.1.1 Performance Issue

I have two instances of Influx DB running, one is version 2.0.5, and the other is 2.1.1. I noticed a performance issue with 2.1.1 that I have not been able to replicate on version 2.0.5. I have the same data being read into each instance. The first data point in both buckets was put there at 2022-01-31T17:20:00.155Z UTC. The data being streamed to each version is coming from the same source, so the vast majority of points should be identical.

I am using the same query on both versions (copy and paste):
from(bucket: “Test”)
|> range(start: 0)
|> filter(fn: (r) => r["_measurement"] == “TotalPower_Raw_AltBadQlty.Raw”)
|> filter(fn: (r) => r["_field"] == “ValueQualityIsGood” or r["_field"] == “Value”)
|> pivot(columnKey: ["_field"], rowKey: ["_time"], valueColumn: “_value”)
|> last(column: “Value”)

Version 2.0.5 takes ~0.15 seconds to return the requested data whereas version 2.1.1 takes ~3.0 seconds. When I remove the pivot function, 2.1.1 returns to the performance expected. I need to use a start time of “0” due to the fact that the data is not evenly spaced and I will not have knowledge of when the last point was created (could be months worth of stale or bad data in some cases). The pivot function is extremely helpful and allows me to do more work on the server side of things vs doing it on the client side of things.

A few characteristics of each bucket:

Version 2.0.5
First point date: 2022-01-31T17:20:00.155Z UTC
Number of Value Points: 509,397
Number of ValueQuality Points: 509,417
Speed of query: ~0.15 seconds

Version 2.1.1
First point date: 2022-01-31T17:20:00.155Z UTC
Number of Value Points: 510,641
Number of ValueQuality Points: 510,660
Speed of query: ~3.0 seconds

Is this an influx issue or is this an issue with my data/query? Like I said, the data should be nearly identical since it is coming from the same source, the only difference is the influx instances are hosted on different servers, so downtime of the servers varies occasionally.