So just to expand on what I said before, If I use the code I just posted, SQLAlchemy caps the query string limit and so it emits 10 - 12 queries instead of just one big query (taking more time). If I pre-build the big INSERT string with Python raw string interpolation, and then I session.execute it, I obtain performance benefits.
On Friday, November 2, 2018 at 4:17:43 PM UTC+1, Ruben Di Battista wrote: > > Hello, > > I have a huge insert of the type: > > ``` > session.execute( > insert_query, > [ > { > 'time': times[i], > 'elevation': elevation[i], > 'azimuth': azimuth[i], > 'doppler': doppler[i], > 'slant': slant[i], > 'passageID': passage_id > } > for i in six.moves.range(0, n) > ] > ) > > ``` > > where n is huge. > > I was told by a colleague that SQLALchemy limits query length to 65536 > chars while MySQL can cappet 33MB big queries. Can I tailor this in > SQLAlchemy? > -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- 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 https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.