from lazyiter import LazyIterator
columns = ['city', 'state', 'population']
yield_per = 100
state_population_iterator = LazyIterator('postgres:///db', 'state_populations', columns, yield_per)
total_population = 0
for city, state, population in state_population_iterator:
total_population += population
....
Python 3, a database that supports SQLAlchemy yield_per
(postgres).