Sqlalchemy
Performance
len-all-count
len-all-count
Using QUERY.count() instead of len(QUERY.all()) sends less data to the client since the SQLAlchemy method is performed server-side.
batch-import
batch-import
Rather than adding one element at a time, consider batch loading to improve performance.