While working on T111494: BadMethodCallException on history of a Flow page, I noticed that the indexes did not seem to take into account offset-id.
Going to https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&action=history&limit=500 , then clicking older 500 takes you to https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&offset=sjts6vxe5bh5pdla&limit=500&action=history , which shows exactly the same output.
This seems to be because the indices ignore offset-id.
Direct DB accesses (e.g. because you exceeded the limit) show the previous 500 is accessible that way. When accessing 1000, the oldest one shown is 22 April 2015.
The 'oldest' link (dir=prev) is also broken. E.g. https://www.mediawiki.org/w/index.php?title=Talk:Sandbox&dir=prev&action=history currently shows an oldest entry of 24 June 2015, which is clearly not the oldest (see above where there is at least 22 April 2015, but there are even older ones). I think it is just showing the oldest ones in the TopKIndex.
Apparently, the DB also does not support pagination, unless I'm missing something. So pagination will only work within the index. You apparently can neither span between index and DB, or paginate the DB itself. However, you can still set whatever limit you want, and that will work.