Avoid N+1 querying MeasureDataPoints per dataset - #273
Open
bbliem wants to merge 1 commit into
Open
Conversation
Each FrameworkMeasure(DVC) dataset loaded during a node computation queried the DB for its own measure datapoints, so an OutcomeNode with many such inputs fired the same query ~10 times per render. Fetch all datapoints for the framework config once and cache them on the Context (Context.measure_datapoints), then slice in memory by UUID. All three call sites in frameworks/datasets.py now share this single query. Fixes PATHS-BACKEND-5VK
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #273 +/- ##
=======================================
Coverage 48.05% 48.06%
=======================================
Files 342 342
Lines 45386 45385 -1
Branches 6794 6795 +1
=======================================
+ Hits 21809 21813 +4
+ Misses 21895 21890 -5
Partials 1682 1682
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Each FrameworkMeasure(DVC) dataset loaded during a node computation queried the DB for its own measure datapoints, so an OutcomeNode with many such inputs fired the same query ~10 times per render.
Fetch all datapoints for the framework config once and cache them on the Context (Context.measure_datapoints), then slice in memory by UUID. All three call sites in frameworks/datasets.py now share this single query.
Fixes PATHS-BACKEND-5VK