perf(db): add missing indexes, fix N+1 batch delete, add pagination limits
- Add indexes on Resource(blueprintId, roleId), DemandRequirement(roleId),
Assignment(roleId) — commonly filtered FK columns that were missing indexes
- Replace N+1 batch delete pattern (2N queries) with findAllocationEntries()
that does 2 total queries via findMany({ id: { in: ids } })
- Add take/skip pagination with default limit of 500 to listDemands and
listAssignments to prevent unbounded result sets
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@ export {
|
||||
|
||||
export {
|
||||
findAllocationEntry,
|
||||
findAllocationEntries,
|
||||
loadAllocationEntry,
|
||||
type AllocationEntryResolution,
|
||||
} from "./use-cases/allocation/load-allocation-entry.js";
|
||||
|
||||
Reference in New Issue
Block a user