Skip to content

BE-641: Restructure the SQL AST into statement/clause/expression modules#9020

Open
TimDiekmann wants to merge 3 commits into
mainfrom
t/be-641-statement-layer-make-every-postgres-statement-we-need
Open

BE-641: Restructure the SQL AST into statement/clause/expression modules#9020
TimDiekmann wants to merge 3 commits into
mainfrom
t/be-641-statement-layer-make-every-postgres-statement-we-need

Conversation

@TimDiekmann

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

First step of BE-641 (making every Postgres statement we need expressible in typed Rust): restructure the SQL AST inside the postgres-store so statements, clauses, and expressions live in dedicated modules and the compiler is clearly separated from the AST it builds. Pure relocation — no behavior, signature, or logic changes. This clears the ground for the follow-up that extends the AST (free CTE names, MATERIALIZED, set operations, subquery predicates), which in turn unblocks the fetch-keys-then-hydrate query shape (BE-598).

🔗 Related links

  • BE-641 (internal)
  • BE-598 (internal) — first consumer of the extended AST

🔍 What does this change?

Best reviewed commit by commit — the first commit is pure file moves (GitHub shows them as renames), the second moves content between files:

  • query/{expression,statement}/query/ast/{statement,clause,expression}/, splitting the former expression/ module (which mostly contained clauses) into the classic statement / clause / expression triad. compile.rs becomes compile/mod.rs.
  • The expression core (formerly conditional.rs, whose name hid the central Expression enum) is split into expression/{mod,function,constant}.rs.
  • The ~1,900 lines of SelectCompiler integration tests that lived in statement/select.rs move to compile/tests.rs, next to the code they test. select.rs is now just the SelectStatement node.
  • WindowStatement moves from statement/ to expression/ (it is only used inside Expression::Window).
  • The flat re-export surface of query/mod.rs is preserved, so no consumers (including hashql-eval, which emits through this AST) needed changes. GroupByExpression/OrderByExpression are newly part of the flat re-exports — they were previously only reachable via nested module paths.

Pre-Merge Checklist 🚀

🚢 Has this modified a publishable library?

This PR:

  • does not modify any publishable blocks or libraries, or modifications do not need publishing

📜 Does this require a change to the docs?

The changes in this PR:

  • are internal and do not require a docs change

🕸️ Does this require a change to the Turbo Graph?

The changes in this PR:

  • do not affect the execution graph

🐾 Next steps

  • Extend the AST on top of this structure: CTE names as free identifiers + MATERIALIZED/NOT MATERIALIZED, set operations (UNION/INTERSECT/EXCEPT), and EXISTS/IN (SELECT …) predicates
  • Convert SelectCompiler into a compositional consumer of the AST (incl. reusing relations instead of duplicate self-joins), then the BE-598 three-phase query shape

🛡 What tests cover this?

  • The full existing unit suite (144 tests, incl. all transpile tests and the relocated SelectCompiler integration tests) runs unchanged and green — no assertions were modified
  • hashql-eval compiles against the unchanged re-export surface

❓ How to test this?

  1. cargo nextest run -p hash-graph-postgres-store --lib
  2. cargo clippy -p hash-graph-postgres-store --all-features --all-targets

Copilot AI review requested due to automatic review settings July 13, 2026 15:34
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Jul 13, 2026 3:42pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Jul 13, 2026 3:42pm
petrinaut Skipped Skipped Jul 13, 2026 3:42pm

@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Pure module moves and import rewiring with no intended logic or API changes; risk is limited to missed import paths, mitigated by the unchanged test suite.

Overview
Reorganizes the postgres-store SQL AST under query/ast/ into statement, clause, and expression modules, and turns compile.rs into compile/mod.rs so compilation stays separate from the tree it builds.

Clause-shaped types that lived under the old expression/ module (e.g. FromItem, WithExpression, SelectExpression) move into ast/clause/; the former conditional.rs core is split into expression/{mod,function,constant,...}.rs, with Function and Constant in their own files. SelectStatement is trimmed to the AST node in ast/statement/select.rs, while the large SelectCompiler integration suite moves to compile/tests.rs. WindowStatement is relocated under expression/ because it only appears inside Expression::Window.

The public query/mod.rs re-export surface is kept (now via ast::*), including newly flat exports for GroupByExpression and OrderByExpression; import paths inside the crate are updated accordingly. The old top-level expression/ and statement/ module trees are removed in favor of ast/.

Reviewed by Cursor Bugbot for commit 4a6acd2. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team labels Jul 13, 2026
@TimDiekmann TimDiekmann requested a review from a team July 13, 2026 15:36

Copilot AI 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.

Pull request overview

Reorganizes the PostgreSQL query AST into dedicated statement, clause, and expression modules without changing SQL compilation behavior.

Changes:

  • Introduces the query::ast hierarchy and updates imports/re-exports.
  • Splits expression primitives and relocates window expressions.
  • Moves SelectCompiler tests beside the compiler implementation.

Reviewed changes

Copilot reviewed 19 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
query/table.rs Updates AST imports.
query/statement/select.rs Removes the former select module and embedded tests.
query/mod.rs Registers and re-exports the new AST structure.
query/expression/mod.rs Removes the legacy expression module layout.
query/compile/tests.rs Houses relocated compiler tests.
query/compile/mod.rs Registers tests and updates AST imports.
query/ast/table_reference.rs Relocates table-reference nodes.
query/ast/statement/select.rs Houses the select statement AST.
query/ast/statement/mod.rs Defines statement exports.
query/ast/statement/insert.rs Updates insert-node imports.
query/ast/mod.rs Defines the unified AST export surface.
query/ast/identifier.rs Relocates identifier handling.
query/ast/expression/window.rs Relocates window expressions.
query/ast/expression/variadic.rs Relocates variadic expressions.
query/ast/expression/unary.rs Relocates unary expressions.
query/ast/expression/mod.rs Organizes expression nodes.
query/ast/expression/function.rs Extracts function expressions.
query/ast/expression/constant.rs Extracts constant expressions.
query/ast/expression/binary.rs Relocates binary expressions.
query/ast/column_reference.rs Updates table-reference imports.
query/ast/clause/with.rs Updates CTE clause imports.
query/ast/clause/where_clause.rs Updates expression transpiler imports.
query/ast/clause/table_sample.rs Relocates table-sampling clauses.
query/ast/clause/select_list.rs Updates select-list imports.
query/ast/clause/order_by.rs Relocates ordering clauses.
query/ast/clause/mod.rs Defines clause exports.
query/ast/clause/join_type.rs Relocates join types.
query/ast/clause/group_by.rs Relocates grouping clauses.
query/ast/clause/from_item.rs Updates FROM-item module imports.

@TimDiekmann TimDiekmann enabled auto-merge July 13, 2026 15:38
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.52174% with 80 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.39%. Comparing base (6736174) to head (4a6acd2).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...rc/store/postgres/query/ast/expression/function.rs 35.48% 80 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9020      +/-   ##
==========================================
- Coverage   59.73%   59.39%   -0.34%     
==========================================
  Files        1371     1373       +2     
  Lines      135461   134345    -1116     
  Branches     6066     6066              
==========================================
- Hits        80911    79796    -1115     
+ Misses      53618    53617       -1     
  Partials      932      932              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.39% <ø> (ø)
apps.hash-api 6.39% <ø> (ø)
local.hash-backend-utils 1.90% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 0.18% <ø> (ø)
rust.hash-graph-api 7.41% <ø> (ø)
rust.hash-graph-postgres-store 24.72% <56.52%> (-4.41%) ⬇️
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-eval 80.04% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark results

@rust/hash-graph-benches – Integrations

policy_resolution_large

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2002 $$28.1 \mathrm{ms} \pm 245 \mathrm{μs}\left({\color{gray}0.609 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.48 \mathrm{ms} \pm 23.1 \mathrm{μs}\left({\color{gray}-1.995 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$12.5 \mathrm{ms} \pm 92.6 \mathrm{μs}\left({\color{gray}-1.077 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.7 \mathrm{ms} \pm 362 \mathrm{μs}\left({\color{gray}-0.717 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$14.3 \mathrm{ms} \pm 142 \mathrm{μs}\left({\color{lightgreen}-5.175 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$24.2 \mathrm{ms} \pm 167 \mathrm{μs}\left({\color{gray}-0.559 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$28.9 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}0.585 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.78 \mathrm{ms} \pm 23.1 \mathrm{μs}\left({\color{gray}-3.318 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.7 \mathrm{ms} \pm 113 \mathrm{μs}\left({\color{gray}-1.977 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.84 \mathrm{ms} \pm 28.7 \mathrm{μs}\left({\color{gray}0.096 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.05 \mathrm{ms} \pm 17.7 \mathrm{μs}\left({\color{gray}0.642 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.47 \mathrm{ms} \pm 26.8 \mathrm{μs}\left({\color{gray}0.971 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.24 \mathrm{ms} \pm 35.9 \mathrm{μs}\left({\color{gray}0.467 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.58 \mathrm{ms} \pm 24.3 \mathrm{μs}\left({\color{gray}-1.056 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.18 \mathrm{ms} \pm 32.3 \mathrm{μs}\left({\color{gray}-1.508 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.47 \mathrm{ms} \pm 25.3 \mathrm{μs}\left({\color{gray}-0.012 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.52 \mathrm{ms} \pm 23.8 \mathrm{μs}\left({\color{gray}0.212 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.16 \mathrm{ms} \pm 32.4 \mathrm{μs}\left({\color{gray}-0.041 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.64 \mathrm{ms} \pm 16.5 \mathrm{μs}\left({\color{gray}-0.373 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.55 \mathrm{ms} \pm 14.8 \mathrm{μs}\left({\color{gray}-0.220 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.60 \mathrm{ms} \pm 12.8 \mathrm{μs}\left({\color{gray}-1.015 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.91 \mathrm{ms} \pm 19.9 \mathrm{μs}\left({\color{gray}0.890 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.71 \mathrm{ms} \pm 19.3 \mathrm{μs}\left({\color{gray}0.953 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.88 \mathrm{ms} \pm 22.7 \mathrm{μs}\left({\color{gray}0.716 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.08 \mathrm{ms} \pm 19.0 \mathrm{μs}\left({\color{gray}0.211 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.78 \mathrm{ms} \pm 14.4 \mathrm{μs}\left({\color{gray}-0.383 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.04 \mathrm{ms} \pm 19.9 \mathrm{μs}\left({\color{gray}2.79 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.48 \mathrm{ms} \pm 18.3 \mathrm{μs}\left({\color{gray}-0.249 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.00 \mathrm{ms} \pm 16.0 \mathrm{μs}\left({\color{gray}-0.180 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.33 \mathrm{ms} \pm 19.9 \mathrm{μs}\left({\color{gray}1.01 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.42 \mathrm{ms} \pm 19.1 \mathrm{μs}\left({\color{gray}-0.181 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.00 \mathrm{ms} \pm 18.5 \mathrm{μs}\left({\color{gray}-1.930 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.42 \mathrm{ms} \pm 29.3 \mathrm{μs}\left({\color{gray}2.61 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$42.3 \mathrm{ms} \pm 261 \mathrm{μs}\left({\color{gray}-0.818 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$32.9 \mathrm{ms} \pm 217 \mathrm{μs}\left({\color{gray}-0.470 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$35.7 \mathrm{ms} \pm 191 \mathrm{μs}\left({\color{gray}0.020 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$34.8 \mathrm{ms} \pm 884 \mathrm{μs}\left({\color{red}9.83 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$41.9 \mathrm{ms} \pm 221 \mathrm{μs}\left({\color{lightgreen}-5.505 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$49.7 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{gray}-0.762 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$40.3 \mathrm{ms} \pm 270 \mathrm{μs}\left({\color{gray}-0.584 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$90.8 \mathrm{ms} \pm 568 \mathrm{μs}\left({\color{gray}-2.075 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$35.1 \mathrm{ms} \pm 1.33 \mathrm{ms}\left({\color{gray}3.82 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$278 \mathrm{ms} \pm 1.08 \mathrm{ms}\left({\color{lightgreen}-10.152 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$10.6 \mathrm{ms} \pm 52.2 \mathrm{μs}\left({\color{gray}-0.416 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$10.7 \mathrm{ms} \pm 61.8 \mathrm{μs}\left({\color{gray}-0.401 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$10.8 \mathrm{ms} \pm 55.9 \mathrm{μs}\left({\color{gray}-0.116 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$10.8 \mathrm{ms} \pm 84.0 \mathrm{μs}\left({\color{gray}0.809 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$10.9 \mathrm{ms} \pm 64.2 \mathrm{μs}\left({\color{gray}-0.274 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$10.7 \mathrm{ms} \pm 66.2 \mathrm{μs}\left({\color{gray}-0.609 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$11.0 \mathrm{ms} \pm 87.8 \mathrm{μs}\left({\color{gray}0.441 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$11.0 \mathrm{ms} \pm 75.0 \mathrm{μs}\left({\color{gray}0.383 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$11.1 \mathrm{ms} \pm 74.5 \mathrm{μs}\left({\color{gray}1.74 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$11.3 \mathrm{ms} \pm 78.0 \mathrm{μs}\left({\color{gray}2.36 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity

Function Value Mean Flame graphs
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/block/v/1 $$11.1 \mathrm{ms} \pm 83.1 \mathrm{μs}\left({\color{gray}-0.004 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$11.2 \mathrm{ms} \pm 77.1 \mathrm{μs}\left({\color{gray}-0.102 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.1 \mathrm{ms} \pm 97.0 \mathrm{μs}\left({\color{gray}0.307 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.1 \mathrm{ms} \pm 75.2 \mathrm{μs}\left({\color{gray}-0.247 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$11.1 \mathrm{ms} \pm 76.3 \mathrm{μs}\left({\color{gray}-0.280 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.1 \mathrm{ms} \pm 65.3 \mathrm{μs}\left({\color{gray}0.180 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$11.0 \mathrm{ms} \pm 70.3 \mathrm{μs}\left({\color{gray}-1.190 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.2 \mathrm{ms} \pm 82.6 \mathrm{μs}\left({\color{gray}1.21 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.2 \mathrm{ms} \pm 82.8 \mathrm{μs}\left({\color{gray}1.08 \mathrm{\%}}\right) $$ Flame Graph

representative_read_entity_type

Function Value Mean Flame graphs
get_entity_type_by_id Account ID: bf5a9ef5-dc3b-43cf-a291-6210c0321eba $$8.78 \mathrm{ms} \pm 53.2 \mathrm{μs}\left({\color{gray}-0.463 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$58.3 \mathrm{ms} \pm 516 \mathrm{μs}\left({\color{gray}3.62 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$114 \mathrm{ms} \pm 683 \mathrm{μs}\left({\color{gray}1.77 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$64.7 \mathrm{ms} \pm 507 \mathrm{μs}\left({\color{gray}2.06 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$74.6 \mathrm{ms} \pm 509 \mathrm{μs}\left({\color{gray}2.85 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$85.4 \mathrm{ms} \pm 559 \mathrm{μs}\left({\color{gray}2.93 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$91.0 \mathrm{ms} \pm 568 \mathrm{μs}\left({\color{gray}2.66 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$44.7 \mathrm{ms} \pm 259 \mathrm{μs}\left({\color{gray}0.274 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$74.9 \mathrm{ms} \pm 437 \mathrm{μs}\left({\color{gray}-0.102 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$51.2 \mathrm{ms} \pm 301 \mathrm{μs}\left({\color{gray}-0.222 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$61.9 \mathrm{ms} \pm 635 \mathrm{μs}\left({\color{gray}1.98 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$63.1 \mathrm{ms} \pm 430 \mathrm{μs}\left({\color{gray}-0.038 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$63.9 \mathrm{ms} \pm 413 \mathrm{μs}\left({\color{gray}0.520 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$121 \mathrm{ms} \pm 829 \mathrm{μs}\left({\color{gray}-4.522 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$132 \mathrm{ms} \pm 617 \mathrm{μs}\left({\color{gray}-4.385 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$18.8 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{lightgreen}-23.576 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$545 \mathrm{ms} \pm 1.48 \mathrm{ms}\left({\color{gray}-0.099 \mathrm{\%}}\right) $$ Flame Graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/libs Relates to first-party libraries/crates/packages (area) type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

2 participants