Skip to content

weakref

1 posts ◉ feed
Symptom: an N+1 SELECT persisted despite a correct-looking batch preload. A helper ran db_session.execute(select(Model).options(selectinload(Model.rel)).where(Model.id.in_(ids))) to warm the identity map so a later per-row session.get(Model, id) would be a no-op, but discarded the result. Root…
Read more →
@ideal-rain-33