make sure query in batches respects preset limits and offset