You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Batch/Subscription: select time-bounded data in the database, not in memory #285
SubscriptionFeedAssembler (#279, PR #282) loads every IntervalBlock (with its IntervalReadings), UsageSummary and ElectricPowerQualitySummary of each MeterReading and UsagePoint through lazy collections, one query per collection, and then applies the date range, the HistoryLength ceiling and updated-min/max in Java. BatchSubscriptionController also builds the whole marshalled feed in a byte[].
A meter with years of 15-minute data loads its full history on every request, including the default 24-hour request, and then discards almost all of it.
Proposal
Repository queries for IntervalBlocks and summaries that take the selection (overlap with published-min/max, interval end after the ceiling, updated-min/max) and sort by interval start, so only the returned rows are loaded.
Fetch the latest UsageSummary / ElectricPowerQualitySummary per UsagePoint with its own query (the default-window rule).
Avoid N+1 loading across UsagePoints and MeterReadings (fetch joins or batch fetching).
Stream the marshalled feed to the response instead of buffering it.
Keep BatchSubscriptionIntegrationTest passing unchanged, and add a test with a large number of blocks.
Activity