Dynatrace REST API pagination issue on pageOffset and pageSize

Following query returned 503023 as record count:

query = SELECT count(*) from usersession<br>startTimestamp = 1641513600000<br>endTimestamp = 1641520800000

But then when I ran following with pageOffset and pageSize, no results returned:

query = SELECT * from usersession<br>startTimestamp = 1641513600000<br>endTimestamp = 1641520800000<br>pageSize = 100<br>pageOffset = 502000

I’m expecting entries from 502000 → 502100.

What am I doing wrong?

pageOffset shouldn’t exceed 5000, generally speaking. I don’t know if this is a hard limit, but as good practice it’s wise to limit this to few thousands. That means narrowing down the start and end timestamps to, say, 5 minutes.

Job worked as expected with these new parameters.