@@ -75,6 +75,7 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
75
75
dependencyLists : [ ] ,
76
76
} ;
77
77
private readonly raToIndex = new Map < string , number > ( ) ;
78
+ private readonly nameToIndex = new Map < string , number > ( ) ;
78
79
79
80
private getPredicateIndex ( name : string , ra : string ) : number {
80
81
let index = this . raToIndex . get ( ra ) ;
@@ -114,8 +115,21 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
114
115
}
115
116
116
117
switch ( evaluationStrategy ) {
117
- case "EXTENSIONAL" :
118
+ case "EXTENSIONAL" : {
119
+ break ;
120
+ }
118
121
case "COMPUTED_EXTENSIONAL" : {
122
+ if ( predicateName . startsWith ( "cached_" ) ) {
123
+ // Add a dependency from a cached COMPUTED_EXTENSIONAL to the predicate with the actual contents.
124
+ // The raHash of the this event may appear in a CACHE_HIT events in the other event log. The dependency
125
+ // we're adding here is needed in order to associate the original predicate with such a cache hit.
126
+ const originalName = predicateName . substring ( "cached_" . length ) ;
127
+ const originalIndex = this . nameToIndex . get ( originalName ) ;
128
+ if ( originalIndex != null ) {
129
+ const index = this . getPredicateIndex ( predicateName , raHash ) ;
130
+ this . data . dependencyLists [ index ] . push ( originalIndex ) ;
131
+ }
132
+ }
119
133
break ;
120
134
}
121
135
case "CACHE_HIT" :
@@ -140,6 +154,7 @@ export class PerformanceOverviewScanner implements EvaluationLogScanner {
140
154
case "NAMED_LOCAL" :
141
155
case "IN_LAYER" : {
142
156
const index = this . getPredicateIndex ( predicateName , raHash ) ;
157
+ this . nameToIndex . set ( predicateName , index ) ;
143
158
let totalTime = 0 ;
144
159
let totalTuples = 0 ;
145
160
if ( evaluationStrategy === "COMPUTE_SIMPLE" ) {
0 commit comments