fix: batch BattingCard/BattingCardRatings lookups in lineup builder (#18) #45

Merged
cal merged 1 commits from ai/paper-dynasty-database#18 into next-release 2026-03-07 03:16:13 +00:00

1 Commits

Author SHA1 Message Date
Cal Corum
62b205bde2 fix: batch BattingCard/BattingCardRatings lookups in lineup builder (#18)
Replace per-player get_or_none() calls in get_bratings() with two bulk
SELECT queries before the position loop, keyed by player_id and card+hand.
This reduces DB round trips from O(3N) to O(2) for all lineup difficulties.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-05 15:31:13 -06:00