query_db view now also returns domain targetids