Intra-query result caching