Skip to content

perf(db): deserialize only selected nested property values - #1324

Open
perfloop-agent wants to merge 2 commits into
HelixDB:mainfrom
perfloop-oss:perfloop-pr-open-qhw1nnhqyc
Open

perfloop-agent wants to merge 2 commits into
HelixDB:mainfrom
perfloop-oss:perfloop-pr-open-qhw1nnhqyc

Conversation

@perfloop-agent

@perfloop-agent perfloop-agent commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Nested Values projections deserialize parent objects to return scalars, including sibling strings, arrays and maps the caller did not select. This change walks the validated archive and deserializes the selected value instead.

Exact stored dotted names still win. Duplicate root names, missing paths and non-object intermediates keep their behavior. The walk uses the full decoder's map visitor, including for validated maps with absent child links or duplicate or out-of-order keys. Record loading, full-record validation and the stored format are unchanged.

Local paired release measurements include complete warm-memory query execution, storage access, validation, output construction and result destruction:

Values workload Metric per query Before median After median Complete pairs
Property-path fixture repeated over 16 nodes Execution-thread allocated bytes 217424 176432 3
Constructed large string, array and map siblings Process CPU ns 1087500 150000 3

Production frequency and cold-storage costs remain unmeasured.

crates/db/benches/projection_materialization/nested.rs adds native cases for small metadata and a large unused string sibling. Native measurement command: cargo bench --locked -p db --bench projection_materialization -- nested --sample-count 3 --min-time 0.02.

Tests

Cargo's focused property-row, resolver and projection checks passed 18 library tests and 1 public-query integration test, with 0 failures or ignored tests. They cover decoder equivalence, name precedence, alignment, corruption, absent map children and lazy errors. Divan's nested projection smoke fixtures completed; scoped Clippy and formatting checks passed.

Case and evidence


Made by Perfloop. Human sponsor: Tomás Senart.

RetriggerView in Greptile

The PR appears safe to merge; no actionable issues were found.

Summary

Nested property reads now walk the validated archive and deserialize only the selected value.

  • Nested property lookups deserialize only the selected value.

No actionable issues were found. Tests were inspected but not run during this review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Validated property row] --> B{Exact stored name?}
  B -->|Yes| E[Deserialize selected value]
  B -->|No| C[Find first root property]
  C --> D[Visit each nested object]
  D -->|Path found| E
  D -->|Missing or non-object| F[Return no value]
Loading

Reviews (1) · Last reviewed commit: "fix(db): follow the decoder traversal fo..." · Reviewed by Greptile

Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant