Since 1.49.0

Native Query Planner

Run the Rust-native query planner in GraphOS Router


Learn about the Rust-native query planner in GraphOS Router v2.x

Background about query planner implementations

In v1.49.0, the router introduced a query planner implemented natively in Rust. This native query planner improves the overall performance and resource utilization of query planning. It existed alongside the legacy JavaScript implementation that uses the V8 JavaScript engine.

As of v1.59.0, the native query planner is the default planner in the router. As a result, the legacy query planner, which was built using Deno and relied on the v8 engine, has been deprecated.

As of v2.x, the legacy query planner has been removed.

Improved performance of native query planner

The native query planner achieves better performance for a variety of graphs. In our tests, we observe:

  • 10x median improvement in query planning time (observed via the apollo.router.query_planning.plan.duration metric)

  • 2.9x improvement in router’s CPU utilization

  • 2.2x improvement in router’s memory usage

You can expect generated plans and subgraph operations in the native query planner to have slight differences when compared to the legacy, JavaScript-based query planner. We've determines these differences to be semantically insignificant, based on an analysis of approximately 2.5 million unique user operations in GraphOS and a comparison of about 630 million operations from actual router deployments running in shadow mode over four months.

note
The subgraph operations generated by the query planner may change with each release. We strongly recommend against relying on their exact shape, as new router features and optimizations may continue to change them.

Metrics for native query planner

The available metrics for the native query planner are listed and described in the router standard instruments) page.

Feedback

Edit on GitHub

Forums