Skip to content

feat: edge neighbour sort - #2689

Open
louisch wants to merge 10 commits into
db_v4from
feature/edge-neighbour-sort
Open

feat: edge neighbour sort#2689
louisch wants to merge 10 commits into
db_v4from
feature/edge-neighbour-sort

Conversation

@louisch

@louisch louisch commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  • raphtory-graphql API for sorting edges by properties on the nodes (neighbours) they connect to.
  • Adding type and name sorting to NodeSortBy in raphtory-graphql

Why are the changes needed?

In the UI I'd like to be able to do a sort of exploded edges by the neighbours that they connect to, then page. The only thing missing was a way for the edge sort to be able to sort by the neighbours that they connect to.

Does this PR introduce any user-facing change? If yes is this documented?

Yes, it's new API endpoints. Docs added above each endpoint function.

How was this patch tested?

Tests added for type sorting, and sorting edges by their neighbours

Are there any further changes required?

No

@louisch louisch changed the title Edge neighbour sort feat: edge neighbour sort Jul 23, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: c60ab13 Previous: 9823ef7 Ratio
lotr_graph/num_edges 2 ns/iter (± 0) 0 ns/iter (± 0) +∞
lotr_graph/num_nodes 3 ns/iter (± 0) 1 ns/iter (± 0) 3
lotr_graph/graph_latest 2 ns/iter (± 0) 0 ns/iter (± 0) +∞
lotr_graph_materialise/materialize 4646910 ns/iter (± 61973) 1564816 ns/iter (± 35303) 2.97
lotr_graph_window_100_materialise/materialize 4787768 ns/iter (± 83842) 1669150 ns/iter (± 10700) 2.87
lotr_graph_window_10_materialise/materialize 1945506 ns/iter (± 34149) 971980 ns/iter (± 4278) 2.00
lotr_graph_subgraph_10pc/num_nodes 9 ns/iter (± 0) 4 ns/iter (± 0) 2.25
lotr_graph_subgraph_10pc_materialise/materialize 1190831 ns/iter (± 21527) 334634 ns/iter (± 1287) 3.56
lotr_graph_subgraph_10pc_windowed_materialise/materialize 681836 ns/iter (± 14304) 230399 ns/iter (± 2617) 2.96
lotr_graph_window_50_layered_materialise/materialize 17529875 ns/iter (± 289003) 3488825 ns/iter (± 24948) 5.02
lotr_graph_persistent_window_50_layered_materialise/materialize 29816128 ns/iter (± 344026) 5298035 ns/iter (± 147912) 5.63

This comment was automatically generated by workflow using github-action-benchmark.

@ljeub-pometry
ljeub-pometry self-requested a review July 31, 2026 08:19

@ljeub-pometry ljeub-pometry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The src and dst options for edge sorting should also take a NodeSortBy (especially useful for graph-level edges)

Comment thread raphtory-graphql/src/model/sorting.rs Outdated
louisch and others added 3 commits August 1, 2026 11:09
Keep the identity-related keys (id, name) adjacent, ahead of type.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses review feedback: src/dst previously accepted only a bool (sort by
node id). Making them Option<NodeSortBy> lets graph-level edge collections
sort by the src/dst node's type/name/property, and unifies all three node
keys (src/dst/neighbour) through compare_node. Breaking schema change:
{ src: true } becomes { src: { id: true } }.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants