Implement beginning to query.