Implement query.