[cx-oracle-users] How to optimize (Pro*C is 5x faster)?
Brought to you by:
atuining
From: Christopher J. B. <cjb...@al...> - 2004-12-31 08:38:10
|
I have some code structured like this: curs.execute(some_sql) rows.fetchmany() while rows: for row in rows: compiled_curs.execute(None, row[0], row[2]) more_rows = compiled_curs.fetchmany() while more_rows: #do something with them more_rows = compiled_curs.fetchmany() rows = curs.fetchmany() # arraysize is set to 3000 for both cursors The problem is that it is so slow. Yes, I realize that its not good to execute sql in a large for loop, but my problem is that this code is something like 5x as slow as the corresponding Pro*C code. Whats going on? Am I just not using the cx_Oracle module efficiently? Why is embedding sql in Pro*C code *so* much faster. Thanks for the help, I hate coding in Pro*C and C ever since I learned Python...please tell me I'm doing something wrong, I'd hate to go back to C! P.S. I'm using cx_Oracle-4.1-beta1. |