Determine and use next_max_id for correct paging.