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] engine.execute() slow with parameterized queries?

2014-05-13 Thread Michael Bayer
OK well of course also, as we have the exact same thing being asked in regards to Oracle right now in another thread, you can of course always bypass a bound value in the most direct way, using text() or literal_column(): q = s.query(Something).filter(Something.foo = literal_column('my value'))

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] Concurrent raw sql execution in a multi-threaded application: Connection is busy with results for another hstmt error

2014-05-13 Thread Sylvester Steele
On Mon, May 12, 2014 at 6:02 PM, Sylvester Steele sylvesterste...@gmail.com wrote: On Mon, May 12, 2014 at 4:53 PM, Michael Bayer mike...@zzzcomputing.comwrote: On May 12, 2014, at 2:30 PM, Sylvester Steele sylvesterste...@gmail.com wrote: the code here isn’t really showing me the

Re: [sqlalchemy] Concurrent raw sql execution in a multi-threaded application: Connection is busy with results for another hstmt error

2014-05-13 Thread Michael Bayer
On May 13, 2014, at 2:23 PM, Sylvester Steele sylvesterste...@gmail.com wrote: ODBC connection pooling setting did not matter. After the above change, code is running in both cases (ODBC connection pooling on or pooling off). Let me know if this is an issue and you need more info. OK so

Re: [sqlalchemy] engine.execute() slow with parameterized queries?

2014-05-13 Thread Seth P
Yep, literal_column() fixed my performance problem. Thanks again for all your help On Tuesday, May 13, 2014 6:15:39 AM UTC-4, Michael Bayer wrote: OK well of course also, as we have the exact same thing being asked in regards to Oracle right now in another thread, you can of course always