Add support for deep queries.