Pack list view runs O(packs x pack_types x rarities) queries for the probability calculation #5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
`pack_list` in `views/cards.py` prefetches `cards__rarity` and preloads owned card ids, but then calls `prob_at_least_one_new_card` once per pack per pack type, and that function:
With ~30 packs and 2-3 pack types this is several hundred queries per page load. Suggested: load the rarity tables once per generation/pack_type, accept pre-fetched cards and owned ids as parameters, and derive god pack weights from the already-built per-rarity card lists.