[cx-oracle-users] Full Table Scan - Bind Variables
Brought to you by:
atuining
From: Anurag C. <anu...@gm...> - 2013-04-25 03:53:30
|
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 |