Implement iterative query.