Some work on the query.