@Profiler.profile
def test_orm_full_objects_chunks(n):
 sess = Session(engine)
 for obj in sess.query(Customer).yield_per(1000).limit(n):
  pass

@ Profiler . profile def test_orm_full_objects_chunks ( n ) : sess = Session ( engine ) for obj in sess . query ( Customer ) . yield_per ( 1000 ) . limit ( n ) : pass
load fully tracked orm objects a chunk at a time using yield_per() .