@@ -64,15 +64,18 @@ private static CypherFactory create(
6464 GraphLoaderContext loadingContext ,
6565 @ Nullable GraphDimensions dimensions
6666 ) {
67- var estimator = new CypherQueryEstimator (loadingContext .transactionContext ().withRestrictedAccess (READ ));
6867
69- EstimationResult nodeQueryEstimation = graphProjectConfig .isFictitiousLoading ()
70- ? ImmutableEstimationResult .of (graphProjectConfig .nodeCount (), 0 )
71- : estimator .getNodeEstimation (graphProjectConfig .nodeQuery ());
68+ EstimationResult nodeEstimation ;
69+ EstimationResult relationEstimation ;
7270
73- EstimationResult relationshipQueryEstimation = graphProjectConfig .isFictitiousLoading ()
74- ? ImmutableEstimationResult .of (graphProjectConfig .relationshipCount (), 0 )
75- : estimator .getRelationshipEstimation (graphProjectConfig .relationshipQuery ());
71+ if (graphProjectConfig .isFictitiousLoading ()) {
72+ nodeEstimation = ImmutableEstimationResult .of (graphProjectConfig .nodeCount (), 0 );
73+ relationEstimation = ImmutableEstimationResult .of (graphProjectConfig .relationshipCount (), 0 );
74+ } else {
75+ var estimator = new CypherQueryEstimator (loadingContext .transactionContext ().withRestrictedAccess (READ ));
76+ nodeEstimation = estimator .getNodeEstimation (graphProjectConfig .nodeQuery ());
77+ relationEstimation = estimator .getRelationshipEstimation (graphProjectConfig .relationshipQuery ());
78+ }
7679
7780 var dimBuilder = ImmutableGraphDimensions .builder ();
7881
@@ -81,17 +84,17 @@ private static CypherFactory create(
8184 }
8285
8386 GraphDimensions dim = ImmutableGraphDimensions .builder ()
84- .highestPossibleNodeCount (nodeQueryEstimation .estimatedRows ())
85- .nodeCount (nodeQueryEstimation .estimatedRows ())
86- .relCountUpperBound (relationshipQueryEstimation .estimatedRows ())
87+ .highestPossibleNodeCount (nodeEstimation .estimatedRows ())
88+ .nodeCount (nodeEstimation .estimatedRows ())
89+ .relCountUpperBound (relationEstimation .estimatedRows ())
8790 .build ();
8891
8992 return new CypherFactory (
9093 graphProjectConfig ,
9194 loadingContext ,
9295 dim ,
93- nodeQueryEstimation ,
94- relationshipQueryEstimation
96+ nodeEstimation ,
97+ relationEstimation
9598 );
9699 }
97100
0 commit comments