TABLE ACCESS FULL [message #223186] |
Wed, 07 March 2007 22:34 |
rahulvasanth
Messages: 34 Registered: January 2006
|
Member |
|
|
I have a query in oracle 10g
SELECT UNIQUE wi.item_size c_item_name
FROM t_web_inventory wi
WHERE decode(style_code,NULL,'0',wi.style_code) = nvl(:c_style_code,'0')
AND decode(color_code,NULL,'0',wi.color_Code) = nvl(:c_color_code,'0')
AND decode(c_width,NULL,'0',wi.width_code) = nvl(:c_width,'0')
AND wi.quantity_at_hand > 0
When I ran the explain plan for the above query I get the following result.
SELECT STATEMENT, GOAL = ALL_ROWS Cost=4 Cardinality=1 Bytes=21
SORT UNIQUE Cost=4 Cardinality=1 Bytes=21
TABLE ACCESS FULL Object owner=SOAS Object name=T_WEB_INVENTORY Cost=3 Cardinality=1 Bytes=21
The query is doing a TABLE ACCESS FULL scan even though I have indexes on T_WEB_INVENTORY table. I want to know why the query is not doing a INDEX scan. Is it because of DECODE function ? But I have used DECODE function in some of the other queries and they are doing proper INDEX scans.
Thanking in advance.
|
|
|
|
|