Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Wrong execution path

-klbOct 8 2010 — edited Oct 19 2010
Query going slow through cx_oracle

select ...
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?

Thanks,

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 16 2010
Added on Oct 8 2010
1 comment
1,334 views