array_name contains 10900 price.

create_price = []
for x in range(0, 10900):
    price = Price(int(array_name[x]), extra=0)
    create_price.append(price)
session.add_all(create_price)

for y in range(1, 10901):
    session.query(Person).filter_by(id=y).update({"price_id": 
session.query(Price).get(y).id},
                                                 synchronize_session=False)
    session.commit()

But this is very slow.. 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to