[cx-oracle-users] Strange problem with query execution...
Brought to you by:
atuining
From: Thierry F. <thi...@on...> - 2012-04-05 07:43:23
|
Hi, I'm using cx_Oracle (actually in release 5.1.1, but with the same symptoms in 5.1 and 5.0.4) through SQLAlchemy to access an Oracle 10g database (release 10.2.0.4). I'm building a web application querying a quite big table (nearly 3.5 millions records), which is indexed correctly. After activating SQLAlchemy "echo SQL" feature, I noticed that : - an SQLAlchemy request takes between 10 and 15 seconds - the same request executed from an SQL worksheet (in Tora) is nearly immediate. So I made a few tests using cx_Oracle without SQLAlchemy and the results are that : - if I execute the same query with parameters (via "cursor.execute("select...", param1=value1,...)", which is the way SQLAlchemy works), it still takes between 10 and 15 seconds; - but if I execute the same request with "hard-coded" parameters, the result is immediate. Any idea (perhaps on the DB side) ? Thanks for any help, Thierry -- Chef de projets internet/intranet Office National des Forêts Direction des Systèmes d'Information 2, Avenue de Saint Mandé 75570 PARIS Cedex 12 Tél. : 01 40 19 59 64 Fax. : 01 40 19 59 85 Mél. : thi...@on... WWW : http://www.onf.fr |