/// <summary> /// Check cache dependencies. (Note: wrapped, so we can write tests guaranteeing we have the same implementation) /// </summary> internal static void IdentifyCacheDependencies(StructuredQuery query, QuerySqlBuilderSettings settings) { // Note: if we are suppressing the root type check, then it means that the caller will be joining the query into a larger query. // (I.e. this is a security subquery in a secured report). // If that is the case, then the parent query will already be registering invalidation watches for the type of that node. // So we don't need to further add them for the security query as well. // This is an important optimisation because there are security reports that apply to all resources, and get joined into nodes that // are only for specific resource types. So without ignoring the root, we would basically invalidate every report as part of every entity change. StructuredQueryHelper.IdentifyResultCacheDependencies(query, false, settings.SuppressRootTypeCheck || settings.SupportRootIdFilter); }