Optimization: `set_source` and `group_by_source` callbacks on types that support loading through
- Dominant language
- Elixir
- Stars
- 2.5k
- Forks
- 426
- Avg merge
- 23h 26m
- Merged PRs (30d)
- 46
Description
Right now, when an attribute supports being "loaded through", what we do is we do its `load` logic for each record. If we add the following optional callbacks to type:
```elixir
@callback set_source(list({record, value})) :: list(value)
@callback group_by_source(list(value)) :: %{primary_key => list(value)}
```
We can use this to allow loading through types in a single pass.
Contributor guide
Research direction
Start by tracing the existing load logic for attributes that support being "loaded through". Determine how the proposed set_source and group_by_source callbacks would enable a single-pass load, and consider the callback inputs and grouped output described in the issue. Done means supported types can load through in one pass without running load logic separately for each record.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- backend, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100