make migration work on datasets larger than zero

single query = not webscale