Skip to content

BE-416: Add Constant::JsonNull, remove Constant::String, add From impls#8468

Merged
TimDiekmann merged 4 commits intomainfrom
t/be-416-allow-for-a-more-diverse-set-of-constant-values-in-queries
Feb 24, 2026
Merged

BE-416: Add Constant::JsonNull, remove Constant::String, add From impls#8468
TimDiekmann merged 4 commits intomainfrom
t/be-416-allow-for-a-more-diverse-set-of-constant-values-in-queries

Conversation

@TimDiekmann
Copy link
Member

@TimDiekmann TimDiekmann commented Feb 22, 2026

🌟 What is the purpose of this PR?

Cleans up the Constant enum in the PostgreSQL query expression system by removing the String variant (string literals should go through Parameter to avoid embedding literals in SQL) and adding ergonomic From trait impls for the remaining variants.

🔗 Related links

  • ...

🚫 Blocked by

  • ...

🔍 What does this change?

  • Removes Constant::String — string values must go through Parameter
  • Implements From<bool> and From<u32> for ergonomic constant creation
  • Improves UnsignedInteger transpilation to use fmt::Display
  • Updates tests to use the new From impls

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

🐾 Next steps

🛡 What tests cover this?

  • Existing unit tests for case expressions, array operations, and transpilation functionality

❓ How to test this?

  1. Checkout the branch
  2. Run cargo nextest run --package hash-graph-postgres-store -E 'test(expression)'

📹 Demo

Rename `Constant::String` to `Constant::Text`, add `Constant::Null` for
NULL literals, and add `From` impls for ergonomic construction. This is a
first step toward supporting a more diverse set of constant values.
@cursor
Copy link

cursor bot commented Feb 22, 2026

PR Summary

Medium Risk
Touches SQL generation semantics and removes a public enum variant, so downstream code may break at compile time and query output can change if callers previously relied on inlined string literals.

Overview
Refactors constant handling in the Postgres query expression layer. Constant::String is removed so string literals are no longer directly embedded into generated SQL, pushing callers toward Expression::Parameter for text values.

Adds Constant::JsonNull (transpiles to 'null'::jsonb) plus From<bool>/From<u32> impls to simplify constant construction, and adjusts transpilation/tests accordingly (including switching array-literal test cases from string constants to parameters).

Written by Cursor Bugbot for commit 358f119. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Feb 22, 2026

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

Project Deployment Actions Updated (UTC)
hash Ready Ready Preview, Comment Feb 23, 2026 2:39pm
petrinaut Ready Ready Preview Feb 23, 2026 2:39pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
hashdotdesign Ignored Ignored Preview Feb 23, 2026 2:39pm
hashdotdesign-tokens Ignored Ignored Preview Feb 23, 2026 2:39pm

@vercel vercel bot temporarily deployed to Preview – petrinaut February 22, 2026 23:54 Inactive
@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 Feb 22, 2026
@augmentcode
Copy link

augmentcode bot commented Feb 22, 2026

🤖 Augment PR Summary

Summary: Refactors the Postgres expression "constant" representation to better model SQL literals.

Changes:

  • Renamed Constant::String to Constant::Text for clearer semantics
  • Added a Constant::Null variant and transpilation to the SQL NULL literal
  • Removed Hash derivation from Constant
  • Implemented From conversions (bool, &'static str, u32) for more ergonomic construction
  • Updated transpilation formatting for unsigned integers and refactored affected tests to use the new conversions

Technical Notes: Constants are still directly inlined into SQL during transpilation (vs parameters), so correctness/safety of literal formatting remains important.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

@codecov
Copy link

codecov bot commented Feb 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.59%. Comparing base (bc6e591) to head (358f119).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8468   +/-   ##
=======================================
  Coverage   62.59%   62.59%           
=======================================
  Files        1296     1296           
  Lines      131048   131054    +6     
  Branches     5488     5488           
=======================================
+ Hits        82032    82038    +6     
  Misses      48106    48106           
  Partials      910      910           
Flag Coverage Δ
apps.hash-ai-worker-ts 1.40% <ø> (ø)
apps.hash-api 0.00% <ø> (ø)
local.hash-graph-sdk 7.78% <ø> (ø)
local.hash-isomorphic-utils 0.00% <ø> (ø)
rust.hash-graph-api 2.86% <ø> (ø)
rust.hash-graph-postgres-store 27.47% <100.00%> (+0.02%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

Add a test asserting Constant::Null transpiles to NULL (not 'NULL').
Add a comment clarifying why Text uses unescaped literals safely:
&'static str is compiler-controlled, user input must go through Parameter.
Neither is needed. String/null values should go through `Parameter`;
`Boolean` and `UnsignedInteger` cover the actual production use cases.

Updates tests to use numeric constants in place of the removed string
variant.
@vercel vercel bot temporarily deployed to Preview – petrinaut February 23, 2026 09:42 Inactive
@TimDiekmann TimDiekmann changed the title BE-416: Refactor Constant enum: rename String to Text, remove Hash, add Null variant and From impls BE-416: Remove Constant::String and add From impls for Constant Feb 23, 2026
indietyp
indietyp previously approved these changes Feb 23, 2026
Base automatically changed from t/be-415-allow-for-expressions-inside-conditions-inside-a-select to main February 23, 2026 12:30
Adds a `JsonNull` variant to `Constant` that transpiles to
`'null'::jsonb` — the JSON null literal, distinct from SQL NULL.
@TimDiekmann TimDiekmann force-pushed the t/be-416-allow-for-a-more-diverse-set-of-constant-values-in-queries branch from baf7344 to 358f119 Compare February 23, 2026 14:30
@github-actions github-actions bot dismissed indietyp’s stale review February 23, 2026 14:31

Your organization requires reapproval when changes are made, so Graphite has dismissed approvals. See the output of git range-diff at https://github.com/hashintel/hash/actions/runs/22310452345

@TimDiekmann TimDiekmann changed the title BE-416: Remove Constant::String and add From impls for Constant BE-416: Add Constant::JsonNull, remove Constant::String, add From impls Feb 23, 2026
Copy link

@cursor cursor bot left a comment

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.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

@github-actions
Copy link
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 $$26.7 \mathrm{ms} \pm 186 \mathrm{μs}\left({\color{gray}1.46 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.79 \mathrm{ms} \pm 16.9 \mathrm{μs}\left({\color{gray}1.08 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1001 $$12.2 \mathrm{ms} \pm 67.5 \mathrm{μs}\left({\color{gray}2.93 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 3314 $$39.2 \mathrm{ms} \pm 305 \mathrm{μs}\left({\color{gray}1.49 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$12.3 \mathrm{ms} \pm 66.6 \mathrm{μs}\left({\color{gray}2.83 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 1526 $$21.6 \mathrm{ms} \pm 123 \mathrm{μs}\left({\color{gray}2.74 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 2078 $$27.4 \mathrm{ms} \pm 151 \mathrm{μs}\left({\color{gray}1.19 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$3.14 \mathrm{ms} \pm 23.3 \mathrm{μs}\left({\color{gray}3.13 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 1033 $$13.0 \mathrm{ms} \pm 81.5 \mathrm{μs}\left({\color{gray}3.91 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_medium

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 102 $$3.12 \mathrm{ms} \pm 21.4 \mathrm{μs}\left({\color{gray}0.505 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.39 \mathrm{ms} \pm 13.8 \mathrm{μs}\left({\color{gray}0.088 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 51 $$2.71 \mathrm{ms} \pm 18.1 \mathrm{μs}\left({\color{gray}-0.724 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 269 $$4.43 \mathrm{ms} \pm 23.3 \mathrm{μs}\left({\color{gray}-0.473 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.95 \mathrm{ms} \pm 21.0 \mathrm{μs}\left({\color{gray}1.46 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 107 $$3.39 \mathrm{ms} \pm 20.6 \mathrm{μs}\left({\color{gray}-0.075 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 133 $$3.79 \mathrm{ms} \pm 32.6 \mathrm{μs}\left({\color{gray}1.24 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.84 \mathrm{ms} \pm 29.5 \mathrm{μs}\left({\color{gray}1.65 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 63 $$3.33 \mathrm{ms} \pm 20.7 \mathrm{μs}\left({\color{gray}0.146 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_none

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 2 $$2.17 \mathrm{ms} \pm 11.9 \mathrm{μs}\left({\color{gray}1.30 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.13 \mathrm{ms} \pm 10.5 \mathrm{μs}\left({\color{gray}0.337 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 1 $$2.24 \mathrm{ms} \pm 16.1 \mathrm{μs}\left({\color{gray}1.62 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 8 $$2.51 \mathrm{ms} \pm 18.8 \mathrm{μs}\left({\color{red}6.25 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.31 \mathrm{ms} \pm 17.5 \mathrm{μs}\left({\color{gray}3.80 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 3 $$2.56 \mathrm{ms} \pm 19.8 \mathrm{μs}\left({\color{gray}3.16 \mathrm{\%}}\right) $$ Flame Graph

policy_resolution_small

Function Value Mean Flame graphs
resolve_policies_for_actor user: empty, selectivity: high, policies: 52 $$2.48 \mathrm{ms} \pm 12.5 \mathrm{μs}\left({\color{gray}-0.217 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: low, policies: 1 $$2.24 \mathrm{ms} \pm 14.2 \mathrm{μs}\left({\color{gray}2.66 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: empty, selectivity: medium, policies: 25 $$2.36 \mathrm{ms} \pm 15.8 \mathrm{μs}\left({\color{gray}2.49 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: high, policies: 94 $$2.82 \mathrm{ms} \pm 24.8 \mathrm{μs}\left({\color{gray}0.244 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: low, policies: 1 $$2.45 \mathrm{ms} \pm 15.3 \mathrm{μs}\left({\color{gray}-0.233 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: seeded, selectivity: medium, policies: 26 $$2.58 \mathrm{ms} \pm 11.8 \mathrm{μs}\left({\color{gray}-0.969 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: high, policies: 66 $$2.72 \mathrm{ms} \pm 14.6 \mathrm{μs}\left({\color{gray}1.07 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: low, policies: 1 $$2.39 \mathrm{ms} \pm 12.8 \mathrm{μs}\left({\color{gray}-1.531 \mathrm{\%}}\right) $$ Flame Graph
resolve_policies_for_actor user: system, selectivity: medium, policies: 29 $$2.58 \mathrm{ms} \pm 14.1 \mathrm{μs}\left({\color{gray}-1.610 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_complete

Function Value Mean Flame graphs
entity_by_id;one_depth 1 entities $$36.0 \mathrm{ms} \pm 288 \mathrm{μs}\left({\color{gray}4.57 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 10 entities $$72.9 \mathrm{ms} \pm 330 \mathrm{μs}\left({\color{gray}-1.111 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 25 entities $$38.7 \mathrm{ms} \pm 195 \mathrm{μs}\left({\color{gray}1.44 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 5 entities $$43.1 \mathrm{ms} \pm 230 \mathrm{μs}\left({\color{gray}0.711 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;one_depth 50 entities $$48.5 \mathrm{ms} \pm 208 \mathrm{μs}\left({\color{gray}-0.745 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 1 entities $$37.8 \mathrm{ms} \pm 292 \mathrm{μs}\left({\color{gray}4.26 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 10 entities $$416 \mathrm{ms} \pm 1.01 \mathrm{ms}\left({\color{gray}-0.021 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 25 entities $$87.7 \mathrm{ms} \pm 415 \mathrm{μs}\left({\color{gray}-1.219 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 5 entities $$87.4 \mathrm{ms} \pm 469 \mathrm{μs}\left({\color{gray}-2.898 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;two_depth 50 entities $$279 \mathrm{ms} \pm 1.15 \mathrm{ms}\left({\color{red}7.31 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 1 entities $$13.5 \mathrm{ms} \pm 120 \mathrm{μs}\left({\color{gray}-4.208 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 10 entities $$13.0 \mathrm{ms} \pm 67.7 \mathrm{μs}\left({\color{lightgreen}-7.401 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 25 entities $$13.4 \mathrm{ms} \pm 71.3 \mathrm{μs}\left({\color{gray}-2.172 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 5 entities $$13.0 \mathrm{ms} \pm 73.6 \mathrm{μs}\left({\color{gray}-4.545 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id;zero_depth 50 entities $$15.8 \mathrm{ms} \pm 85.5 \mathrm{μs}\left({\color{lightgreen}-5.002 \mathrm{\%}}\right) $$ Flame Graph

read_scaling_linkless

Function Value Mean Flame graphs
entity_by_id 1 entities $$12.8 \mathrm{ms} \pm 66.0 \mathrm{μs}\left({\color{lightgreen}-6.737 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10 entities $$12.9 \mathrm{ms} \pm 51.4 \mathrm{μs}\left({\color{gray}-3.365 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 100 entities $$12.9 \mathrm{ms} \pm 57.4 \mathrm{μs}\left({\color{gray}-3.307 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 1000 entities $$13.8 \mathrm{ms} \pm 77.4 \mathrm{μs}\left({\color{lightgreen}-5.057 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id 10000 entities $$20.9 \mathrm{ms} \pm 126 \mathrm{μs}\left({\color{lightgreen}-5.333 \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 $$28.2 \mathrm{ms} \pm 272 \mathrm{μs}\left({\color{lightgreen}-6.147 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/book/v/1 $$27.4 \mathrm{ms} \pm 304 \mathrm{μs}\left({\color{lightgreen}-9.762 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/building/v/1 $$27.4 \mathrm{ms} \pm 262 \mathrm{μs}\left({\color{lightgreen}-9.147 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/organization/v/1 $$27.5 \mathrm{ms} \pm 285 \mathrm{μs}\left({\color{lightgreen}-8.754 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/page/v/2 $$28.2 \mathrm{ms} \pm 313 \mathrm{μs}\left({\color{gray}-3.477 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/person/v/1 $$28.8 \mathrm{ms} \pm 373 \mathrm{μs}\left({\color{gray}-1.337 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/playlist/v/1 $$28.2 \mathrm{ms} \pm 263 \mathrm{μs}\left({\color{lightgreen}-5.163 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/song/v/1 $$27.3 \mathrm{ms} \pm 274 \mathrm{μs}\left({\color{lightgreen}-8.165 \mathrm{\%}}\right) $$ Flame Graph
entity_by_id entity type ID: https://blockprotocol.org/@alice/types/entity-type/uk-address/v/1 $$28.7 \mathrm{ms} \pm 300 \mathrm{μs}\left({\color{gray}-0.485 \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 $$6.88 \mathrm{ms} \pm 54.7 \mathrm{μs}\left({\color{gray}-0.812 \mathrm{\%}}\right) $$ Flame Graph

representative_read_multiple_entities

Function Value Mean Flame graphs
entity_by_property traversal_paths=0 0 $$92.4 \mathrm{ms} \pm 547 \mathrm{μs}\left({\color{gray}-1.137 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=255 1,resolve_depths=inherit:1;values:255;properties:255;links:127;link_dests:126;type:true $$137 \mathrm{ms} \pm 681 \mathrm{μs}\left({\color{gray}1.90 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:0;link_dests:0;type:false $$99.4 \mathrm{ms} \pm 494 \mathrm{μs}\left({\color{gray}0.614 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:0;links:1;link_dests:0;type:true $$105 \mathrm{ms} \pm 491 \mathrm{μs}\left({\color{gray}-0.160 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:0;properties:2;links:1;link_dests:0;type:true $$114 \mathrm{ms} \pm 565 \mathrm{μs}\left({\color{gray}0.433 \mathrm{\%}}\right) $$
entity_by_property traversal_paths=2 1,resolve_depths=inherit:0;values:2;properties:2;links:1;link_dests:0;type:true $$119 \mathrm{ms} \pm 582 \mathrm{μs}\left({\color{gray}-0.309 \mathrm{\%}}\right) $$
link_by_source_by_property traversal_paths=0 0 $$86.5 \mathrm{ms} \pm 482 \mathrm{μs}\left({\color{gray}-1.645 \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 $$111 \mathrm{ms} \pm 526 \mathrm{μs}\left({\color{gray}0.007 \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 $$92.2 \mathrm{ms} \pm 464 \mathrm{μs}\left({\color{gray}-2.039 \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 $$99.9 \mathrm{ms} \pm 460 \mathrm{μs}\left({\color{gray}-0.143 \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 $$103 \mathrm{ms} \pm 522 \mathrm{μs}\left({\color{gray}0.574 \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 $$103 \mathrm{ms} \pm 523 \mathrm{μs}\left({\color{gray}-0.174 \mathrm{\%}}\right) $$

scenarios

Function Value Mean Flame graphs
full_test query-limited $$127 \mathrm{ms} \pm 611 \mathrm{μs}\left({\color{gray}4.29 \mathrm{\%}}\right) $$ Flame Graph
full_test query-unlimited $$125 \mathrm{ms} \pm 556 \mathrm{μs}\left({\color{red}6.25 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-limited $$90.7 \mathrm{ms} \pm 477 \mathrm{μs}\left({\color{gray}0.269 \mathrm{\%}}\right) $$ Flame Graph
linked_queries query-unlimited $$548 \mathrm{ms} \pm 3.03 \mathrm{ms}\left({\color{gray}-4.022 \mathrm{\%}}\right) $$ Flame Graph

@TimDiekmann TimDiekmann added this pull request to the merge queue Feb 24, 2026
Merged via the queue into main with commit cf568ba Feb 24, 2026
85 checks passed
@TimDiekmann TimDiekmann deleted the t/be-416-allow-for-a-more-diverse-set-of-constant-values-in-queries branch February 24, 2026 09:09
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