feat: Optimized Device connections and DB-level selector filtering#1412
Draft
davidebriani wants to merge 1 commit intoedgehog-device-manager:mainfrom
Draft
Conversation
057cfa6 to
b92ace8
Compare
Replaces the unpaginated manual relationship `devices` in `DeviceGroup` with a scalable root `devices` connection that translates the group selector into a native Ash.Expr database filter. Updates Channel calculations (updatable_devices, deployable_devices, download_capable_devices) to execute Postgres-level filters instead of loading devices into memory, resolving OOM risks on huge groups. Updates the frontend `DeviceGroup` component to query the root connection and consume the standard `DevicesTable` component. Signed-off-by: Davide Briani <davide.briani@secomind.com>
b92ace8 to
72bc8bb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
selectorresolution into a scalable database-level filter via theDeviceread action.ManualRelationshiplist to prevent BEAM OOM crashes on large groups.devicesas a root GraphQL Connection matching the group ID, enabling native Relay cursor pagination.Channelcalculations (updatable_devices,deployable_devices,download_capable_devices) to push large OR expressions down to PostgreSQL.This prepares the backend for swapping NimbleParsec to CEL in the next phase without performance regressions.
Migrations
No database schema changes required in this step. Frontend gracefully degrades by switching to
DevicesTable.