On Apr 4, 2012, at 11:40 AM, Borax wrote:

> Le mercredi 4 avril 2012 16:27:39 UTC+2, Michael Bayer a écrit :
> this all comes down to the nature of the SQL being emitted.
> 
> what is the SQL being emitted by SQLAlchemy in this case, and what is the SQL 
> that should be emitted ?  Working with SQLAlchemy in a non-trivial way 
> implies you're using echo=True or otherwise logging queries during 
> development, and are watching what it does at every step - this is how you 
> tune your app essentially.
> 
> That's exactly what I did : activate "echo" to get SQL code in a console, and 
> then copy it "as is" in Tora's SQL worksheet.
> The only difference for me (beyond response delay !) is that SQLAlchemy seems 
> to use prepared statements with query parameters, while Tora doesn't...

well prepared statements are the standard approach and that's what cx_Oracle is 
doing here.    So you might want to reproduce your problem using a cx_Oracle 
script directly, illustrate that behavior is different with cx_Oracle vs. 
direct, then ask on the cx_Oracle list why indexes might not be honored:

https://lists.sourceforge.net/lists/listinfo/cx-oracle-users

sample cx_oracle script:

import cx_Oracle
conn = cx_Oracle.connect("scott", "tiger", "mytnsname")
cursor = conn.cursor()
cursor.execute("SELECT x FROM table WHERE y=:y", y=5)
cursor.fetchall()



-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@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.

Reply via email to