Skip to content

QP execution: avoid redundant entity responses from aliased operations#9122

Open
duckki wants to merge 1 commit intoduckki/fed-897from
duckki/fed-897-take-2
Open

QP execution: avoid redundant entity responses from aliased operations#9122
duckki wants to merge 1 commit intoduckki/fed-897from
duckki/fed-897-take-2

Conversation

@duckki
Copy link
Copy Markdown
Contributor

@duckki duckki commented Apr 1, 2026

(This is an add-on optimization on top of PR #9071.)

Eliminate redundant entity responses by splitting $representations per context

When contexts differ across entities, the aliased _entities query
previously shared a single $representations array across all aliases,
producing an N×M response matrix where only N values were needed.

This change gives each _entities_<i> alias its own singleton
$representations_<i> variable containing only the one representation
needed for that context, reducing subgraph response size from N×M to N.

Also optimizes aliased error remapping by pre-building a
context-to-path HashMap for O(1) lookups instead of linear scans.


Checklist

Complete the checklist (and note appropriate exceptions) before the PR is marked ready-for-review.

  • PR description explains the motivation for the change and relevant context for reviewing
  • PR description links appropriate GitHub/Jira tickets (creating when necessary)
  • Changeset is included for user-facing changes
  • Changes are compatible[^1]
  • Documentation[^2] completed
  • Performance impact assessed and acceptable
  • Metrics and logs are added[^3] and documented
  • Tests added and passing[^4]
    • Unit tests
    • Integration tests
    • Manual tests, as necessary

…r context

When contexts differ across entities, the aliased _entities query
previously shared a single $representations array across all aliases,
producing an N×M response matrix where only N values were needed.

This change gives each _entities_<i> alias its own singleton
$representations_<i> variable containing only the one representation
needed for that context, reducing subgraph response size from N×M to N.

Also optimizes aliased error remapping by pre-building a
context-to-path HashMap for O(1) lookups instead of linear scans.
@duckki duckki requested a review from a team as a code owner April 1, 2026 21:01
@apollo-librarian
Copy link
Copy Markdown
Contributor

apollo-librarian bot commented Apr 1, 2026

✅ Docs preview ready

The preview is ready to be viewed. View the preview

File Changes

0 new, 2 changed, 0 removed
* graphos/routing/(latest)/observability/graphos/federated-trace-data.mdx
* graphos/routing/(latest)/observability/router-telemetry-otel/enabling-telemetry/standard-instruments.mdx

Build ID: d3add78272e910fbb74b6554
Build Logs: View logs

URL: https://www.apollographql.com/docs/deploy-preview/d3add78272e910fbb74b6554


✅ AI Style Review — No Changes Detected

No MDX files were changed in this pull request.

Review Log: View detailed log

This review is AI-generated. Please use common sense when accepting these suggestions, as they may not always be accurate or appropriate for your specific context.

@duckki duckki changed the title Eliminate redundant entity responses by splitting $representations pe… QP execution: avoid redundant entity responses from aliased operations Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant