Just a detail - wfProfileOut should be called after this line, not before. We may also consider removing duplicates from mInvalidationQueue - either here or when constructing the query.