Skip to content

BE-538: HashQL: Permission system integration#8882

Draft
indietyp wants to merge 31 commits into
bm/be-71-hashql-consider-merging-ast-stagesfrom
bm/be-538-hashql-permission-system-integration
Draft

BE-538: HashQL: Permission system integration#8882
indietyp wants to merge 31 commits into
bm/be-71-hashql-consider-merging-ast-stagesfrom
bm/be-538-hashql-permission-system-integration

Conversation

@indietyp

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

Integrates the authorization policy system into HashQL query execution. Compiled queries are now patched at runtime with actor-specific permit/forbid conditions (WHERE clause) and property masking (CASE WHEN projections), achieving parity with the existing PolicyComponents + Filter::for_policies system used by the REST entity endpoints.

Size note: This PR is large (75 files, ~4.8k added). If review is difficult, it can be split into 4 stacked PRs:

Production Tests Snapshots HTTP
PR1: Prerequisites (patch system, projections, shared test infra) ~800 ~500 ~30
PR2: Policy (permit/forbid WHERE clause) ~400 ~600 ~200
PR3: Protection (property masking graft) ~250 ~700 ~500
PR4: API wiring (REST integration, diagnostics) ~350 ~69

🚫 Blocked by

These PRs rework the underlying entity tables and query compilation that the authorization graft targets. Once they land, this PR will need to undergo some adjustments.

🔍 What does this change?

Authorization patching system (eval/src/postgres/authorization/)

  • Policy admission: translates Cedar-style permit/forbid policies into SQL WHERE predicates, with two-phase lowering (blank permit/forbid detection before expression allocation to avoid dead parameters)
  • Property masking: generates CASE WHEN expressions grafted into the entity_editions LATERAL subquery, stripping protected property keys from properties and property_metadata columns
  • HList/CPS pipeline (PreparedQueryPatch): typed layer composition where each layer receives a next continuation, registers join demands before materialization, and can rewrite the FROM tree after
  • Auxiliary parameters: Vec<Box<dyn ToSql + Sync>> sidepiece on PreparedQuery, chained as borrowed refs during encoding, separate from the compiler's Parameters system

REST API wiring (graph/api/src/rest/hashql/)

  • PolicyComponents built per-request from the authenticated actor and query-derived actions
  • PropertyProtectionFilterConfig read from the store pool settings (respects HASH_GRAPH_SKIP_FILTER_PROTECTION)
  • Proper diagnostics: actor_not_found (ERROR/400) vs authorization_context_failed (BUG/500), with DetermineActor checking inner cause to distinguish store errors from genuine not-found

Projection system (eval/src/postgres/projections.rs)

  • AuxiliaryProjections: tracks compiled join aliases, detects existing joins (punch-through), registers new join demands
  • build_joins: materializes auth joins into the FROM tree via mem::replace on CrossJoin right spine, maintaining LATERAL ordering (non-LATERAL before LATERAL)
  • find_from_by_alias: recursive FROM tree walker for locating graft targets

Test infrastructure

  • Shared CompilationFixture in postgres/tests.rs used by both filter and authorization tests
  • MockStore implementing PrincipalStore + PolicyStore with strict assertions (actor UUID, action, principal context)
  • 45 authorization unit tests (policy algebra, protection lowering, projection building, 5 E2E integration)
  • HTTP tests updated: all HashQL requests now authenticate, plus new tests for missing header and invalid actor

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

⚠️ Known issues

  • PropertyProtectionFilterConfig uses HashMap internally, so SQL generation order for multiple protected properties is non-deterministic. Semantics are order-independent (concatenated mask expression), but query plans could theoretically differ between requests. The multi-property test uses structural assertions instead of snapshots to avoid flakiness.

🛡 What tests cover this?

  • 45 authorization unit tests: policy algebra (7), protection lowering (14), projection building (7), side-effect assertions (5), E2E integration (5), structural assertions (7)
  • 24 filter tests (migrated to shared infrastructure)
  • HTTP integration tests: missing auth header (400), invalid actor with diagnostic (400), authenticated queries (200)
  • All existing HashQL HTTP tests updated to pass actor ID

❓ How to test this?

  1. Start the stack (yarn dev:backend)
  2. Run HTTP tests: cd tests/graph/http && yarn reset-database && yarn httpyac send --all tests/hashql.http
  3. Verify: 10/10 pass, including auth header rejection and invalid actor diagnostic
  4. Run Rust tests: cargo test --lib --package hashql-eval -- postgres

@vercel

vercel Bot commented Jun 18, 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 Jun 19, 2026 3:31pm
petrinaut Ready Ready Preview Jun 19, 2026 3:31pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Jun 19, 2026 3:31pm

@vercel vercel Bot temporarily deployed to Preview – petrinaut June 18, 2026 15:18 Inactive
@github-actions github-actions Bot added area/apps > hash* Affects HASH (a `hash-*` app) area/libs Relates to first-party libraries/crates/packages (area) labels Jun 18, 2026

indietyp commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

@indietyp indietyp force-pushed the bm/be-538-hashql-permission-system-integration branch from 123c395 to 9dd3bb2 Compare June 18, 2026 15:21
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 18, 2026 15:21 Inactive
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 18, 2026 15:31 Inactive
@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.51923% with 213 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.54%. Comparing base (2d4919c) to head (12fa94b).

Files with missing lines Patch % Lines
libs/@local/graph/api/src/rest/hashql/mod.rs 0.00% 69 Missing ⚠️
libs/@local/graph/api/src/rest/hashql/error.rs 0.00% 67 Missing ⚠️
libs/@local/hashql/eval/src/postgres/prepared.rs 69.31% 27 Missing ⚠️
...ocal/hashql/eval/src/postgres/authorization/mod.rs 82.02% 12 Missing and 4 partials ⚠️
libs/@local/graph/api/src/rest/hashql/compile.rs 0.00% 9 Missing ⚠️
.../eval/src/postgres/authorization/protection/mod.rs 92.52% 8 Missing ⚠️
libs/@local/graph/api/src/rest/mod.rs 0.00% 5 Missing ⚠️
...local/hashql/eval/src/orchestrator/request/iter.rs 80.76% 5 Missing ⚠️
...ibs/@local/hashql/eval/src/postgres/projections.rs 98.22% 2 Missing and 3 partials ⚠️
...shql/eval/src/postgres/authorization/policy/mod.rs 99.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@                               Coverage Diff                                @@
##           bm/be-71-hashql-consider-merging-ast-stages    #8882       +/-   ##
================================================================================
- Coverage                                        59.69%   23.54%   -36.16%     
================================================================================
  Files                                             1239      551      -688     
  Lines                                           124281    27759    -96522     
  Branches                                          5479     3066     -2413     
================================================================================
- Hits                                             74186     6535    -67651     
+ Misses                                           49254    21130    -28124     
+ Partials                                           841       94      -747     
Flag Coverage Δ
apps.hash-ai-worker-ts 1.39% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
blockprotocol.type-system ?
local.claude-hooks ?
local.harpc-client ?
local.hash-backend-utils 2.81% <ø> (ø)
local.hash-graph-sdk 9.63% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.antsi ?
rust.error-stack ?
rust.harpc-codec ?
rust.harpc-net ?
rust.harpc-tower ?
rust.harpc-types ?
rust.harpc-wire-protocol ?
rust.hash-codec ?
rust.hash-graph-api 7.63% <0.00%> (-0.18%) ⬇️
rust.hash-graph-authorization ?
rust.hash-graph-postgres-store ?
rust.hash-graph-store ?
rust.hash-graph-temporal-versioning ?
rust.hash-graph-types ?
rust.hash-graph-validation 83.43% <ø> (ø)
rust.hashql-ast ?
rust.hashql-compiletest 28.40% <ø> (ø)
rust.hashql-core ?
rust.hashql-diagnostics ?
rust.hashql-eval 82.08% <92.92%> (+2.64%) ⬆️
rust.hashql-hir ?
rust.hashql-mir ?
rust.hashql-syntax-jexpr ?

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.

@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 08:14 Inactive
@indietyp indietyp force-pushed the bm/be-538-hashql-permission-system-integration branch from 7ead119 to 8b8ed10 Compare June 19, 2026 08:15
@indietyp indietyp force-pushed the bm/be-71-hashql-consider-merging-ast-stages branch from d5457fd to 2b9c6dd Compare June 19, 2026 08:15
@vercel vercel Bot temporarily deployed to Preview – petrinaut June 19, 2026 08:15 Inactive
@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.4 \mathrm{ms} \pm 224 \mathrm{μs}\left({\color{gray}0.547 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.63 \mathrm{ms} \pm 29.1 \mathrm{μs}\left({\color{gray}0.273 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$13.3 \mathrm{ms} \pm 118 \mathrm{μs}\left({\color{gray}-2.581 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$43.5 \mathrm{ms} \pm 325 \mathrm{μs}\left({\color{gray}-2.859 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.7 \mathrm{ms} \pm 213 \mathrm{μs}\left({\color{gray}-4.164 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$24.6 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}-2.555 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$30.0 \mathrm{ms} \pm 222 \mathrm{μs}\left({\color{gray}2.49 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.92 \mathrm{ms} \pm 20.3 \mathrm{μs}\left({\color{gray}-0.862 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$14.4 \mathrm{ms} \pm 108 \mathrm{μs}\left({\color{gray}-2.502 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.94 \mathrm{ms} \pm 29.9 \mathrm{μs}\left({\color{gray}1.26 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.05 \mathrm{ms} \pm 20.1 \mathrm{μs}\left({\color{gray}-1.150 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$3.46 \mathrm{ms} \pm 24.2 \mathrm{μs}\left({\color{gray}0.250 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.49 \mathrm{ms} \pm 48.0 \mathrm{μs}\left({\color{gray}3.68 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.65 \mathrm{ms} \pm 23.8 \mathrm{μs}\left({\color{gray}0.013 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$4.31 \mathrm{ms} \pm 35.7 \mathrm{μs}\left({\color{gray}2.24 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.66 \mathrm{ms} \pm 35.4 \mathrm{μs}\left({\color{gray}2.94 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.69 \mathrm{ms} \pm 29.8 \mathrm{μs}\left({\color{gray}3.21 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.39 \mathrm{ms} \pm 30.4 \mathrm{μs}\left({\color{gray}4.42 \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 19.0 \mathrm{μs}\left({\color{gray}-4.959 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.55 \mathrm{ms} \pm 13.3 \mathrm{μs}\left({\color{gray}-1.570 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.62 \mathrm{ms} \pm 15.9 \mathrm{μs}\left({\color{gray}-4.478 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.87 \mathrm{ms} \pm 23.1 \mathrm{μs}\left({\color{gray}-4.665 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.68 \mathrm{ms} \pm 16.6 \mathrm{μs}\left({\color{lightgreen}-7.550 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.85 \mathrm{ms} \pm 17.2 \mathrm{μs}\left({\color{lightgreen}-6.477 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.09 \mathrm{ms} \pm 18.6 \mathrm{μs}\left({\color{gray}-1.581 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.81 \mathrm{ms} \pm 16.7 \mathrm{μs}\left({\color{gray}-1.403 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$3.06 \mathrm{ms} \pm 20.5 \mathrm{μs}\left({\color{gray}-1.836 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.53 \mathrm{ms} \pm 26.1 \mathrm{μs}\left({\color{gray}-0.821 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.06 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}1.30 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$3.34 \mathrm{ms} \pm 24.0 \mathrm{μs}\left({\color{gray}-0.061 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.39 \mathrm{ms} \pm 26.3 \mathrm{μs}\left({\color{gray}-1.969 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.00 \mathrm{ms} \pm 18.2 \mathrm{μs}\left({\color{gray}-1.325 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.41 \mathrm{ms} \pm 21.3 \mathrm{μs}\left({\color{gray}-1.017 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$56.9 \mathrm{ms} \pm 330 \mathrm{μs}\left({\color{gray}-1.690 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$48.4 \mathrm{ms} \pm 315 \mathrm{μs}\left({\color{gray}1.07 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$52.9 \mathrm{ms} \pm 390 \mathrm{μs}\left({\color{gray}0.362 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$46.5 \mathrm{ms} \pm 283 \mathrm{μs}\left({\color{gray}-1.221 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$64.6 \mathrm{ms} \pm 487 \mathrm{μs}\left({\color{gray}0.042 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$65.1 \mathrm{ms} \pm 423 \mathrm{μs}\left({\color{gray}0.987 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$59.5 \mathrm{ms} \pm 412 \mathrm{μs}\left({\color{gray}2.01 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$109 \mathrm{ms} \pm 799 \mathrm{μs}\left({\color{gray}0.014 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$48.4 \mathrm{ms} \pm 240 \mathrm{μs}\left({\color{gray}-0.892 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$334 \mathrm{ms} \pm 1.29 \mathrm{ms}\left({\color{red}18.1 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$20.3 \mathrm{ms} \pm 137 \mathrm{μs}\left({\color{gray}2.27 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$21.3 \mathrm{ms} \pm 112 \mathrm{μs}\left({\color{gray}3.35 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$22.1 \mathrm{ms} \pm 176 \mathrm{μs}\left({\color{red}6.53 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$20.5 \mathrm{ms} \pm 134 \mathrm{μs}\left({\color{gray}3.57 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$26.9 \mathrm{ms} \pm 159 \mathrm{μs}\left({\color{red}9.35 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$20.1 \mathrm{ms} \pm 114 \mathrm{μs}\left({\color{red}5.58 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$20.2 \mathrm{ms} \pm 135 \mathrm{μs}\left({\color{gray}1.84 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$20.3 \mathrm{ms} \pm 123 \mathrm{μs}\left({\color{gray}2.52 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$20.3 \mathrm{ms} \pm 128 \mathrm{μs}\left({\color{gray}-3.352 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$26.7 \mathrm{ms} \pm 200 \mathrm{μs}\left({\color{lightgreen}-5.081 \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 $$38.4 \mathrm{ms} \pm 320 \mathrm{μs}\left({\color{gray}0.656 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$38.3 \mathrm{ms} \pm 293 \mathrm{μs}\left({\color{red}6.39 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$37.4 \mathrm{ms} \pm 381 \mathrm{μs}\left({\color{gray}1.50 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$37.5 \mathrm{ms} \pm 381 \mathrm{μs}\left({\color{gray}2.94 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$38.7 \mathrm{ms} \pm 354 \mathrm{μs}\left({\color{gray}2.41 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$37.4 \mathrm{ms} \pm 345 \mathrm{μs}\left({\color{gray}-0.361 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$38.1 \mathrm{ms} \pm 437 \mathrm{μs}\left({\color{gray}2.02 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$37.9 \mathrm{ms} \pm 345 \mathrm{μs}\left({\color{gray}0.011 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$36.8 \mathrm{ms} \pm 380 \mathrm{μs}\left({\color{gray}0.781 \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.97 \mathrm{ms} \pm 53.7 \mathrm{μs}\left({\color{gray}0.274 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$98.4 \mathrm{ms} \pm 617 \mathrm{μs}\left({\color{gray}-1.601 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$161 \mathrm{ms} \pm 709 \mathrm{μs}\left({\color{red}6.86 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$107 \mathrm{ms} \pm 711 \mathrm{μs}\left({\color{gray}2.81 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$121 \mathrm{ms} \pm 729 \mathrm{μs}\left({\color{red}5.33 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$128 \mathrm{ms} \pm 849 \mathrm{μs}\left({\color{gray}4.19 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$139 \mathrm{ms} \pm 743 \mathrm{μs}\left({\color{red}8.62 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$111 \mathrm{ms} \pm 658 \mathrm{μs}\left({\color{red}6.50 \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 $$139 \mathrm{ms} \pm 840 \mathrm{μs}\left({\color{gray}2.87 \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 $$117 \mathrm{ms} \pm 679 \mathrm{μs}\left({\color{red}6.04 \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 $$125 \mathrm{ms} \pm 630 \mathrm{μs}\left({\color{gray}3.46 \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 $$130 \mathrm{ms} \pm 576 \mathrm{μs}\left({\color{red}5.95 \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 $$127 \mathrm{ms} \pm 682 \mathrm{μs}\left({\color{gray}4.47 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$188 \mathrm{ms} \pm 1.10 \mathrm{ms}\left({\color{red}16.6 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$169 \mathrm{ms} \pm 2.44 \mathrm{ms}\left({\color{red}12.5 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$41.5 \mathrm{ms} \pm 315 \mathrm{μs}\left({\color{gray}-4.084 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$564 \mathrm{ms} \pm 1.22 \mathrm{ms}\left({\color{gray}2.94 \mathrm{\%}}\right) $$ Flame Graph

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

Labels

area/apps > hash* Affects HASH (a `hash-*` app) area/apps > hash-graph area/apps area/libs Relates to first-party libraries/crates/packages (area) area/tests New or updated tests type/eng > backend Owned by the @backend team

Development

Successfully merging this pull request may close these issues.

1 participant