Hello.

Is there any performance (plus communication) difference between

    # bulk insert of several rows
    new_rows = []
    for i in range(10):
        new_rows.append({'foo': i, 'bar': i})
    cls.__table__.insert().execute(new_rows)

and

    for i in range(10):
        ins = cls.__table__.insert().values({
            'foo': i,
            'bar': i
        })
        session.execute(ins)

I guess there is. If so, can the second example be written more efficiently (but
still using session)?


Thank you,

Ladislav Lenart

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to