Oracle Community Directory
Oracle Community FAQ
My Oracle Support Community (MOSC)
Go Directly To
Oracle Technology Network Community
My Oracle Support Community
OPN Cloud Connection
Oracle Employee Community
Oracle User Group Community
OTN Speaker Bureau
Please enter a title.
You can not post a blank message. Please type your message and try again.
Database Application Development
This discussion is archived
on Oct 20, 2010 2:25 AM by 734879
Wrong execution path
Oct 8, 2010 9:30 PM
Query going slow through cx_oracle
from big_table a, small_table b
where a.col1= :bind1
and a.col2 = :bind2
and a.col3 = :bind3
and a.col4 = :bind4
and a.col5 = b.col1
This query, when executed via SQLPLUS uses nested loops=>big table rowid via index range scan, with small table rowid index unique scan. Perfect, and very fast.
When going through python, it does a full table scan on big_table nested loops to the index unique scan on small-table.
Even with hint /*+ INDEX(a ix_on_those_columns) */, the query from python does a full table scan against the oracle table.
The statistics are up to date on the objects.
What could be causing this?
I have the same question
Show 0 Likes
This content has been marked as final.
Show 1 reply
Re: Wrong execution path
Oct 20, 2010 2:25 AM
in response to
conn.cursor().execute("alter session set events '10046 trace name context forever, level 12'")
...before you execute the query. Format the trace file using tkprof and the issue will usually jump out at you.