dotnet / dotnet/efcore

Json: consider deduplication when projecting scalars

Open
#29,839 0 comments 0 reactions 0 assignees View on GitHub
area-json area-perf
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

Currently we perform deduplication for projected json entities, i.e. if we project json entity and subsequently we also project another json entity that is "inside" the one we projected earlier, we retrieve the data for that second entity directly from the first. This allows us to save data sent over the wire, as well as reduce number of reader calls.

We could consider similar thing for scalars - if multiple scalars from the same aggregate are projected out, we could find common denominator and project that instead, and then in the shaper access the individual scalar values, like we do for entities.

This might be bit tricky however, need to change the way we translate queries (so that we keep part of the json traversal as "client eval"), also need to double check if it's a perf benefit - we would do fewer reader calls, but in many cases would bring more data over the wire.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.