After and orderdesc: question on large datasets, ordering, and pagination

I have not tried orderBy with after. I generally use after: with natural ordering to process UIDs for a bulk operation such as a specialized export, schema update etc.

If you just want consistent paging, you might instead use start: and offset. If you are concerned about updates perturbing the results, use a long-running transaction via client.newTransaction() and make all calls within that read transaction. All retrieval will use a single point-in-time snapshot so results don’t change during paging.

See also: Java - DQL or other client libraries for transaction management