Full Table Scan - Bind Variables

Anurag Chourasia <[email protected]>
Newsgroups gmane.comp.python.db.cx-oracle
Message-ID <CANFgmFCrE4dcMUwe+EAcyY03NEFbbRw9yXfbbLkS98HHJNVnEQ@mail.gmail.com>
Dear Friends,

My query is doing a full table scan when running from within the Web App.

I captured the plan of execution using LAB128 and this is what i see
http://dpaste.com/1072780/ The plan indicates a full table scan.

The query in question is *SELECT BATCH FROM ASSET WHERE ID = :ID and SUB_ID
= :SUB_ID*

The columns in the where clause are both *varchar2* and in cx_oracle, the
query looks like this

WMS_cursor.execute("SELECT BATCH FROM ASSET WHERE ID = :ID and SUB_ID =
:SUB_ID" ,{'ID':ID, 'SUB_ID':SUB_ID})

ID and SUB_ID are both *unicode* type variables in Python.

If i generate the plan of the same query in SQL Tools, i see that the index
is being used. Plan as seen in SQLTools is http://dpaste.com/1072779/

The index *ASSET_IND_7* is a new index that was created on this table.

Why should the query do a FULL TABLE SCAN when running from inside the WEB
App? Is it something wrong with the Bind Variables?

Please help.

Regards,
Guddu

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr

_______________________________________________
cx-oracle-users mailing list
cx-oracle-users-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/cx-oracle-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.