Re: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-13 Thread Thierry Florac
Hi Michael, We already tried to explain the Oracle query execution plan with our DBA. The result is that the Oracle server prefers to make a full table scan instead of using the index; the reason is still indeterminate (the database statistics are up to date), we checked arguments data type and as

RE: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-13 Thread Gombas, Gabor
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

Re: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-13 Thread Michael Bayer
On May 13, 2014, at 4:21 AM, Thierry Florac tflo...@gmail.com wrote: Hi Michael, We already tried to explain the Oracle query execution plan with our DBA. The result is that the Oracle server prefers to make a full table scan instead of using the index; the reason is still indeterminate

Re: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-13 Thread Thierry Florac
Hi Michael, I just tried using literal_column function and now performances are as good as they can :-/ As my problem is only limited to a single use case, using this method, even if not perfect (arguments must be carefully verified!), if far better than a global option. Many thanks, Thierry

Re: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-12 Thread Michael Bayer
On May 12, 2014, at 6:12 PM, Thierry Florac tflo...@gmail.com wrote: Hi, I use Python and SQLAlchemy to access an Oracle 11 database. As far as I think, SQLAlchemy always use prepared statements. SQLAlchemy has no control over this as the DBAPI has no prepared statement system exposed