I'm getting 1000x slower inserts with sqlalchemy in comparison with plain 
inserts with cx_oracle.
The issue seems to be only when using the Insert object rather than a plain 
insert sql as a string.
Inside the function _execute_context, it calls context.pre_exec() which 
inside cx_oracle's pre_exec function, you have the call for the 
self.set_input_sizes that causes the issue...
Without that set_input_sizes command, the code runs in seconds instead of 
minutes.
In my example, all the data is from the type Text which in turn become CLOB 
in Oracle.

I'm using sqlalchemy 1.2.7 (Not the latest but doesn't seem like there's 
any change in that code in 1.2.8 or in source) and cx_oracle 6.3.1 (latest)
My Python version is 3.6.x and if it matters, the code that calls the 
sqlalchemy code is pandas 0.23.0 (0.23.1 is latest) but the issue seems to 
be sqlalchemy-related.
I would love any help with it! For now I copied the execute function 
without that line just to make things faster for now but it would be much 
better if there was a real solution.

-- 
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.

Reply via email to