File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/query/plan/cascades Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,13 @@ public abstract class Quantifier implements Correlated<Quantifier> {
94
94
@ Nonnull
95
95
private final CorrelationIdentifier alias ;
96
96
97
+ /**
98
+ * As a quantifier is immutable, the correlated set can be computed lazily and then cached. This supplier
99
+ * represents that cached set.
100
+ */
101
+ @ Nonnull
102
+ private final Supplier <Set <CorrelationIdentifier >> correlatedToSupplier ;
103
+
97
104
/**
98
105
* As a quantifier is immutable, the columns that flow along the quantifier can be lazily computed.
99
106
*/
@@ -577,6 +584,7 @@ public static Physical physical(@Nonnull final Reference reference,
577
584
578
585
protected Quantifier (@ Nonnull final CorrelationIdentifier alias ) {
579
586
this .alias = alias ;
587
+ this .correlatedToSupplier = Suppliers .memoize (() -> getRangesOver ().getCorrelatedTo ());
580
588
this .flowedColumnsSupplier = Suppliers .memoize (this ::computeFlowedColumns );
581
589
this .flowedValuesSupplier = Suppliers .memoize (this ::computeFlowedValues );
582
590
// Call debugger hook for this new quantifier.
@@ -664,7 +672,7 @@ public String toString() {
664
672
@ Nonnull
665
673
@ Override
666
674
public Set <CorrelationIdentifier > getCorrelatedTo () {
667
- return getRangesOver (). getCorrelatedTo ();
675
+ return correlatedToSupplier . get ();
668
676
}
669
677
670
678
/**
You can’t perform that action at this time.
0 commit comments