improved fetching of query triples