Skip to content

BE-781: hgraph: Entity event feed with deletion tombstones - #9303

Merged
TimDiekmann merged 5 commits into
bm/be-780-record-which-property-produced-each-cached-entity-labelfrom
bm/be-781-entity-event-feed-with-deletion-tombstones
Aug 27, 2026
Merged

BE-781: hgraph: Entity event feed with deletion tombstones#9303
TimDiekmann merged 5 commits into
bm/be-780-record-which-property-produced-each-cached-entity-labelfrom
bm/be-781-entity-event-feed-with-deletion-tombstones

Conversation

@indietyp

@indietyp indietyp commented Aug 24, 2026

Copy link
Copy Markdown
Member

🌟 What is the purpose of this PR?

Entities gain deletion tombstones and an event feed. A deletion now writes who deleted and when (transaction and decision time) into entity_ids, with a check constraint holding the tombstone total or absent. The new feed module serves ordered change events polled from current rows in two arms: changed for present rows and ended for decision-closed ones. Consumers that mirror entity state can now hear about deletions, which the store previously forgot.

The migrations pair as in #9302: V59 (deletion provenance columns), V60 (feed indexes), and V61 (feed statistics) alter deployed databases, and the same schema enters the fresh-database v009 here. The V60/V61 objects exist because the feed's predicates are expressions, which carry no column statistics. The migration comments state what each object fixes and the measured plan bounds.

Review focus: feed completeness at the poll-window edges (an event exactly on a boundary) and across the split between the two arms. The tests/deletion suite exercises the crossings.

🔍 What does this change?

  • graph-migrations/v009__entities/up.sql: tombstone columns with their totality constraint and partial index, plus the feed indexes and extended statistics.
  • postgres_migrations/V59, V60, V61: the same schema for deployed databases.
  • knowledge/entity/feed.rs: the feed. snapshot/entity/channel.rs carries the deletion fields through snapshots.
  • delete.rs: tombstone writes. provenance.rs: the deletion provenance column.
  • rows.rs, table.rs, insert.rs: the Deleted* row vocabulary and fixtures.
  • Cargo.toml: pin-project-lite for the feed stream plumbing.
  • tests/deletion/: a new integration suite (drafts, erase, feed, links, purge).

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

🛡 What tests cover this?

  • tests/deletion/ under the integration harness, which provisions its own scratch database.
  • The existing postgres-store lib suite covers this, plus the workspace battery: cargo check including all test targets, clippy at zero warnings, fmt clean.

❓ How to test this?

cargo nextest run -p hash-graph-postgres-store --lib
turbo run test:integration --filter @rust/hash-graph-postgres-store

@vercel

vercel Bot commented Aug 24, 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 Aug 27, 2026 3:27pm
petrinaut Ready Ready Preview Aug 27, 2026 3:27pm
petrinaut-docs Ready Ready Preview Aug 27, 2026 3:27pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
hashdotdesign-tokens Ignored Ignored Preview Aug 27, 2026 3:27pm

Request Review

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 15.92920% with 95 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.76%. Comparing base (5793745) to head (1fedd7e).

Files with missing lines Patch % Lines
...-store/src/store/postgres/knowledge/entity/feed.rs 0.00% 63 Missing ⚠️
...raph/postgres-store/src/snapshot/entity/channel.rs 0.00% 12 Missing ⚠️
...tore/src/store/postgres/knowledge/entity/delete.rs 0.00% 8 Missing ⚠️
...ph/postgres-store/src/store/postgres/query/rows.rs 66.66% 6 Missing ⚠️
...store/src/store/postgres/knowledge/entity/query.rs 0.00% 3 Missing ⚠️
.../src/store/postgres/knowledge/entity/provenance.rs 0.00% 2 Missing ⚠️
...h/postgres-store/src/store/postgres/query/table.rs 85.71% 1 Missing ⚠️
Additional details and impacted files
@@                                          Coverage Diff                                          @@
##           bm/be-780-record-which-property-produced-each-cached-entity-label    #9303      +/-   ##
=====================================================================================================
- Coverage                                                              60.79%   60.76%   -0.04%     
=====================================================================================================
  Files                                                                   1440     1441       +1     
  Lines                                                                 143491   143588      +97     
  Branches                                                                6662     6662              
=====================================================================================================
+ Hits                                                                   87231    87246      +15     
- Misses                                                                 55169    55251      +82     
  Partials                                                                1091     1091              
Flag Coverage Δ
apps.hash-ai-worker-ts 1.99% <ø> (ø)
apps.hash-api 14.68% <ø> (ø)
local.hash-backend-utils 3.27% <ø> (ø)
local.hash-graph-sdk 10.02% <ø> (ø)
local.hash-isomorphic-utils 12.22% <ø> (ø)
rust.hash-graph-api 24.95% <ø> (ø)
rust.hash-graph-postgres-store 32.02% <15.92%> (-0.08%) ⬇️
rust.hashql-compiletest 28.39% <ø> (ø)
rust.hashql-eval 79.82% <ø> (ø)

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.

@codspeed-hq

codspeed-hq Bot commented Aug 24, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 15.38%

❌ 2 regressed benchmarks
✅ 96 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
bit_matrix/dense/iter_row[64] 140.8 ns 170 ns -17.16%
bit_matrix/dense/iter_row[200] 185.8 ns 215 ns -13.57%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing bm/be-781-entity-event-feed-with-deletion-tombstones (1fedd7e) with main (57396c9)1

Open in CodSpeed

Footnotes

  1. No successful run was found on bm/be-780-record-which-property-produced-each-cached-entity-label (5793745) during the generation of this report, so main (57396c9) was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@indietyp
indietyp force-pushed the bm/be-781-entity-event-feed-with-deletion-tombstones branch from 44205e8 to d73044f Compare August 24, 2026 15:21
@indietyp indietyp changed the title feat: deletion tombstones and entity feed BE-781: hgraph: Entity event feed with deletion tombstones Aug 24, 2026
@indietyp indietyp self-assigned this Aug 24, 2026
@indietyp
indietyp force-pushed the bm/be-781-entity-event-feed-with-deletion-tombstones branch from d73044f to 91d6965 Compare August 24, 2026 15:53
@indietyp
indietyp marked this pull request as ready for review August 24, 2026 15:54
@indietyp
indietyp requested a review from a team as a code owner August 24, 2026 15:54
@cursor

cursor Bot commented Aug 24, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches core entity storage, purge semantics, and a new consumer-facing poll API with documented watermark/lag and erase/restore edge cases; migrations backfill live tombstones from JSONB.

Overview
Adds a transaction-time watermark feed (PostgresStore::entity_events_since) so consumers can mirror published entity state: Updated (present-row changes), Ended (present closed with no successor, e.g. archived incoming links on purge), and Deleted (purge tombstones). One SQL snapshot unions the three arms; partial indexes and extended statistics target the feed predicates.

Purge deletions no longer stash deletion provenance in entity_ids.provenance JSONB. They write deleted_by_id / deleted_at_transaction_time / deleted_at_decision_time with an all-or-nothing CHECK and a partial index on deletion time. V59 backfills and strips legacy JSON keys; V60/V61 add feed indexes and planner stats; fresh installs get the same in v009. Row types, bulk insert, snapshot restore, and update_entity_ids_provenance follow the column layout; deletion timestamps are truncated to whole seconds.

New tests/deletion/feed (plus tombstone/provenance test updates) cover feed dispatch, strict watermark boundaries, and erase vs purge behavior.

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

TimDiekmann
TimDiekmann previously approved these changes Aug 26, 2026
@TimDiekmann
TimDiekmann added this pull request to the merge queue Aug 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Aug 26, 2026
@indietyp
indietyp added this pull request to the merge queue Aug 26, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue because a pull request earlier in the stack was removed Aug 26, 2026
@indietyp
indietyp dismissed TimDiekmann’s stale review August 27, 2026 09:14

The merge-base changed after approval.

@indietyp
indietyp force-pushed the bm/be-781-entity-event-feed-with-deletion-tombstones branch from 5fcc246 to 6fd8c18 Compare August 27, 2026 09:14
@vercel
vercel Bot temporarily deployed to Preview – petrinaut August 27, 2026 10:40 Inactive
@vercel
vercel Bot temporarily deployed to Preview – petrinaut-docs August 27, 2026 10:40 Inactive
@indietyp
indietyp force-pushed the bm/be-781-entity-event-feed-with-deletion-tombstones branch from dd3d18b to 3a0ffaf Compare August 27, 2026 11:05
@indietyp
indietyp deployed to pull-request August 27, 2026 11:06 — with GitHub Actions Active

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit da89aa0. Configure here.

@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 $$25.9 \mathrm{ms} \pm 183 \mathrm{μs}\left({\color{gray}-4.559 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.52 \mathrm{ms} \pm 17.3 \mathrm{μs}\left({\color{gray}-2.373 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1002 $$12.3 \mathrm{ms} \pm 125 \mathrm{μs}\left({\color{lightgreen}-6.855 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$42.7 \mathrm{ms} \pm 433 \mathrm{μs}\left({\color{gray}-3.566 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$15.4 \mathrm{ms} \pm 167 \mathrm{μs}\left({\color{gray}-3.228 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1527 $$23.7 \mathrm{ms} \pm 198 \mathrm{μs}\left({\color{lightgreen}-9.213 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$26.6 \mathrm{ms} \pm 161 \mathrm{μs}\left({\color{gray}-2.458 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.90 \mathrm{ms} \pm 27.3 \mathrm{μs}\left({\color{gray}-1.395 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.3 \mathrm{ms} \pm 120 \mathrm{μs}\left({\color{lightgreen}-9.470 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.81 \mathrm{ms} \pm 26.8 \mathrm{μs}\left({\color{gray}-0.957 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$3.08 \mathrm{ms} \pm 20.1 \mathrm{μs}\left({\color{gray}-1.034 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 52 $$3.44 \mathrm{ms} \pm 21.9 \mathrm{μs}\left({\color{gray}-2.706 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$5.24 \mathrm{ms} \pm 35.5 \mathrm{μs}\left({\color{lightgreen}-5.336 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.70 \mathrm{ms} \pm 28.5 \mathrm{μs}\left({\color{gray}0.931 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 108 $$4.40 \mathrm{ms} \pm 32.1 \mathrm{μs}\left({\color{gray}3.62 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$4.44 \mathrm{ms} \pm 32.1 \mathrm{μs}\left({\color{gray}-3.413 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.58 \mathrm{ms} \pm 21.4 \mathrm{μs}\left({\color{gray}0.727 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$4.20 \mathrm{ms} \pm 34.1 \mathrm{μs}\left({\color{gray}-4.691 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.80 \mathrm{ms} \pm 26.0 \mathrm{μs}\left({\color{gray}1.79 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.58 \mathrm{ms} \pm 15.5 \mathrm{μs}\left({\color{gray}-0.775 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 2 $$2.74 \mathrm{ms} \pm 22.8 \mathrm{μs}\left({\color{gray}0.291 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.97 \mathrm{ms} \pm 14.9 \mathrm{μs}\left({\color{gray}-2.336 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.79 \mathrm{ms} \pm 17.4 \mathrm{μs}\left({\color{gray}-4.243 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.94 \mathrm{ms} \pm 14.1 \mathrm{μs}\left({\color{gray}-1.665 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$3.11 \mathrm{ms} \pm 21.5 \mathrm{μs}\left({\color{gray}-0.617 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.86 \mathrm{ms} \pm 17.9 \mathrm{μs}\left({\color{gray}1.83 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 26 $$3.15 \mathrm{ms} \pm 25.5 \mathrm{μs}\left({\color{gray}2.15 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$3.50 \mathrm{ms} \pm 25.8 \mathrm{μs}\left({\color{gray}-2.149 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$3.06 \mathrm{ms} \pm 17.2 \mathrm{μs}\left({\color{gray}-0.477 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 27 $$3.39 \mathrm{ms} \pm 19.8 \mathrm{μs}\left({\color{gray}-2.553 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$3.41 \mathrm{ms} \pm 20.6 \mathrm{μs}\left({\color{gray}-3.476 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.07 \mathrm{ms} \pm 19.0 \mathrm{μs}\left({\color{gray}-0.258 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$3.42 \mathrm{ms} \pm 25.5 \mathrm{μs}\left({\color{gray}-3.131 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$43.8 \mathrm{ms} \pm 217 \mathrm{μs}\left({\color{gray}3.73 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$33.9 \mathrm{ms} \pm 210 \mathrm{μs}\left({\color{gray}-3.980 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$36.8 \mathrm{ms} \pm 260 \mathrm{μs}\left({\color{gray}-1.200 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$39.7 \mathrm{ms} \pm 1.26 \mathrm{ms}\left({\color{gray}4.08 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$44.9 \mathrm{ms} \pm 375 \mathrm{μs}\left({\color{gray}3.94 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$51.4 \mathrm{ms} \pm 317 \mathrm{μs}\left({\color{gray}3.64 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$43.3 \mathrm{ms} \pm 278 \mathrm{μs}\left({\color{gray}3.98 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$90.0 \mathrm{ms} \pm 563 \mathrm{μs}\left({\color{gray}-4.848 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$34.8 \mathrm{ms} \pm 220 \mathrm{μs}\left({\color{gray}-2.621 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$282 \mathrm{ms} \pm 1.12 \mathrm{ms}\left({\color{red}6.04 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$11.6 \mathrm{ms} \pm 70.1 \mathrm{μs}\left({\color{red}6.14 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$11.1 \mathrm{ms} \pm 74.7 \mathrm{μs}\left({\color{gray}1.80 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$11.1 \mathrm{ms} \pm 74.1 \mathrm{μs}\left({\color{gray}-0.198 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$10.7 \mathrm{ms} \pm 68.4 \mathrm{μs}\left({\color{gray}-0.668 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$11.0 \mathrm{ms} \pm 63.4 \mathrm{μs}\left({\color{gray}-2.036 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$11.0 \mathrm{ms} \pm 56.6 \mathrm{μs}\left({\color{gray}1.43 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$11.3 \mathrm{ms} \pm 89.8 \mathrm{μs}\left({\color{gray}0.393 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$10.8 \mathrm{ms} \pm 65.4 \mathrm{μs}\left({\color{lightgreen}-7.604 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$11.1 \mathrm{ms} \pm 70.9 \mathrm{μs}\left({\color{gray}1.20 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$11.4 \mathrm{ms} \pm 69.8 \mathrm{μs}\left({\color{gray}3.89 \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.8 \mathrm{ms} \pm 91.3 \mathrm{μs}\left({\color{red}6.44 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$12.0 \mathrm{ms} \pm 103 \mathrm{μs}\left({\color{red}10.5 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$11.5 \mathrm{ms} \pm 76.5 \mathrm{μs}\left({\color{gray}4.92 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$11.5 \mathrm{ms} \pm 79.4 \mathrm{μs}\left({\color{red}5.61 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$12.0 \mathrm{ms} \pm 106 \mathrm{μs}\left({\color{red}6.28 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$11.8 \mathrm{ms} \pm 70.8 \mathrm{μs}\left({\color{red}8.21 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$12.0 \mathrm{ms} \pm 82.4 \mathrm{μs}\left({\color{red}8.27 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$11.5 \mathrm{ms} \pm 97.0 \mathrm{μs}\left({\color{red}5.30 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$11.9 \mathrm{ms} \pm 81.8 \mathrm{μs}\left({\color{red}10.1 \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.72 \mathrm{ms} \pm 59.9 \mathrm{μs}\left({\color{red}7.75 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$61.7 \mathrm{ms} \pm 567 \mathrm{μs}\left({\color{red}11.0 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$119 \mathrm{ms} \pm 752 \mathrm{μs}\left({\color{red}11.1 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$68.4 \mathrm{ms} \pm 538 \mathrm{μs}\left({\color{red}5.98 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$77.6 \mathrm{ms} \pm 566 \mathrm{μs}\left({\color{gray}3.84 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$88.4 \mathrm{ms} \pm 700 \mathrm{μs}\left({\color{gray}3.00 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$94.3 \mathrm{ms} \pm 639 \mathrm{μs}\left({\color{red}8.22 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$45.5 \mathrm{ms} \pm 239 \mathrm{μs}\left({\color{red}5.89 \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 $$76.1 \mathrm{ms} \pm 364 \mathrm{μs}\left({\color{red}7.57 \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 $$52.9 \mathrm{ms} \pm 517 \mathrm{μs}\left({\color{red}7.69 \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 $$63.2 \mathrm{ms} \pm 528 \mathrm{μs}\left({\color{red}9.53 \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 $$70.2 \mathrm{ms} \pm 538 \mathrm{μs}\left({\color{red}18.1 \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 $$66.9 \mathrm{ms} \pm 349 \mathrm{μs}\left({\color{red}12.4 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$126 \mathrm{ms} \pm 591 \mathrm{μs}\left({\color{gray}-4.515 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$138 \mathrm{ms} \pm 462 \mathrm{μs}\left({\color{lightgreen}-5.706 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$17.8 \mathrm{ms} \pm 117 \mathrm{μs}\left({\color{gray}-3.761 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$543 \mathrm{ms} \pm 1.02 \mathrm{ms}\left({\color{gray}2.85 \mathrm{\%}}\right) $$ Flame Graph

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

Labels

area/deps Relates to third-party dependencies (area) 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.

2 participants