Alternative to SELECT ... LIMIT / OFFSET for pagination?

I’m trying to migrate data in order to perform some updates that are impossible in InflxuDB (e.g. convert tag to field, rename field, delete tag). To do that, I’m using SELECT … LIMIT with increasing OFFSETs. However, that gets slower and slower (from 0 seconds to 4 minutes when the offset is around 30M):

Worse, when the offset gets high enough, influxd crashes:

Is there a workaround? Other than SELECT INTO, which ended up corrupting my source measurement.

One workaround is to not use OFFSET, but add a WHERE time > ${timeOffset} clause, and set timeOffset to the last read value. It’s worked well for some series, reducing the query time to ~3 seconds, but for others (involving a WHERE foo='bar' OR foo='baz' AND time > ${timeOffset} clause), the query time is still ~3 minutes.

This suggestion worked for me too! Many thanks for the suggestion! Although it would be nice if the OFFSET had worked too.