Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Avoid unnecessary precomputation during query planner construction ([PR #8373](https://github.com/apollographql/router/pull/8373))

A regression introduced in v2.5.0 caused query planner construction to unnecessarily precompute metadata, which can lead to increased CPU and memory utilization during supergraph loading. Query planner construction now correctly avoids this unnecessary precomputation.

By [@sachindshinde](https://github.com/sachindshinde) in https://github.com/apollographql/router/pull/8373
8 changes: 6 additions & 2 deletions apollo-federation/src/query_graph/build_query_graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,12 @@ impl SchemaQueryGraphBuilder {
if self.for_query_planning {
self.add_additional_abstract_type_edges()?;
}
// This method adds no nodes/edges, but just precomputes followup edge information.
self.base.precompute_non_trivial_followup_edges()?;
// This method adds no nodes/edges, but just precomputes followup edge information. We don't
// need this when building subgraph query graphs (since federated query graph building takes
// care of it), so we accordingly skip precomputation in that case.
if self.subgraph.is_none() {
self.base.precompute_non_trivial_followup_edges()?;
}
Ok(self.base.build())
}

Expand Down