Paginated ORM query with joinedload returns wrong page sizes and slow total count
Symptom A server-side paginated listing built on SQLAlchemy ORM (2.0-style select() with Session.execute() ) needs to show page numbers plus a total result count. The query applies limit() / offset() and also eager-loads a one-to-many collection with joinedload() . Observed behavior to diagnose With SQL echoing enabled, the generated statement wraps everythi