Hi,

Maybe you’ve run into this: 
https://groups.google.com/forum/#!topic/sqlalchemy/8Xn31vBfGKU

Gabor

From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] On 
Behalf Of Thierry Florac
Sent: 12 May 2014 23:13
To: sqlalchemy
Subject: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

Hi,

I use Python and SQLAlchemy to access an Oracle 11 database. As far as I think, 
SQLAlchemy always use prepared statements.

On a huge table (4 millions records), correctly indexed, SQLAlchemy filters 
queries doesn't use the index, so doing a full table scan is very slow ; using 
the same SQL code in a "raw" SQL editor (SQLplus) make Oracle use the index 
with good performances.

We tried to add "+index" hints on requests, without effect on Oracle execution 
path which still doesn't want to use the index.

Any idea ? Is it possible to really force Oracle to use an index, or to make 
SQLAlchemy to not use prepared statements ??

Best regards,
Thierry
--
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<mailto:sqlalchemy+unsubscr...@googlegroups.com>.
To post to this group, send email to 
sqlalchemy@googlegroups.com<mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.


________________________________

NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.

-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to