Hello, I am working on an application that inserts ~30000 rows. Each of them with a self-generating column (auto increment)
I have them all in a list, and I perform a session.add_all(list) My problem is that the insert process is extremely slow. I inspected the SQL queries and saw that for every item there is a SQL statement. Obviously it is very slow, as multiple insert statements vs insert statement of multiple items is much slower. Naturally, the problem is that SA collects the generated id, that is why every statement is executed alone, and than the generated id is retrieved. I was wondering though, is there some kind of a more efficient mechanism? At least on MySQL, under InnoDB [or with table locking] all the items can be inserted, and individual Id's can be calculated. Is there any development there? Moreover, even if self-generating id is not involved, there will always be multiple insert statements. So generally, is there a more efficient insert mechanism available for SA? Regards, Mati -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.