Skip to content

refactor: prune relationship projections before query execution - #919

Open
jechol wants to merge 1 commit into
ash-project:mainfrom
jechol:perf/prune-relationship-projections
Open

jechol wants to merge 1 commit into
ash-project:mainfrom
jechol:perf/prune-relationship-projections

Conversation

@jechol

@jechol jechol commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Apply relationship projection pruning immediately before normal reads, lateral relationship loads, aggregate reads and calculation queries execute. Doing this at the execution boundary allows later calculations, filters and sorts to reuse the same relationship join.

Requires ash-project/ash_sql#281 to be merged first. The minimum ash_sql version is provisionally 0.8.9 and should be confirmed against the actual release.

Tests cover two calculations on the latest comment, filtering and sorting by another comment field, and loading the complete relationship.

I've put together a runnable example with formatted before/after SQL.

Contributor checklist

Leave anything that you believe does not apply unchecked.

  • I accept the AI Policy, or AI was not used in the creation of this PR.
  • Bug fixes include regression tests
  • Chores
  • Documentation changes
  • Features include unit/acceptance tests
  • Refactoring
  • Update dependencies

@jechol
jechol marked this pull request as ready for review November 9, 2026 02:14
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T02:22:33.763136Z e285cda Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

This branch has not been deployed

No deployments
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