|
|
|
|
|
|
|
|
Re: Alternative way to avoid full scan? [message #345156 is a reply to message #345116] |
Tue, 02 September 2008 07:35 |
Olivia
Messages: 519 Registered: June 2008
|
Senior Member |
|
|
For a particular query following below the plan after making changes in query.
Plan got for the condition like '%.zip' in where clause
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
--------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 37 | 167 |
| 1 | SORT GROUP BY | | 1 | 37 | |
| 2 | TABLE ACCESS BY INDEX ROWID| TRANSFER_DATA_TBL | 1 | 29 | 4 |
| 3 | NESTED LOOPS | | 1 | 37 | 167 |
| 4 | INDEX FAST FULL SCAN | I3_C_ITEM | 1 | 8 | 163 |
| 5 | INDEX RANGE SCAN | TRANSFER_DATA_TBL_PKEY | 1 | | 2 |
--------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------
Plan got after creating a FBI and replacing like by substr
Using FBI (substr(col,-4) I am getting below explain plan and response time s for the query is less here
---------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost |
---------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 37 | 166 |
| 1 | SORT GROUP BY | | 1 | 37 | |
| 2 | HASH JOIN | | 1 | 37 | 166 |
| 3 | INDEX FAST FULL SCAN | I3_C_ITEM | 1 | 8 | 163 |
| 4 | TABLE ACCESS BY INDEX ROWID| TRANSFER_DATA_TBL | 7895 | 223K| 2 |
| 5 | INDEX RANGE SCAN | I4_TRANSFER_DATA_TBL | 3196 | | 1 |
---------------------------------------------------------------------------------------------
Want to know which plan would is better?
Thanks in adavance,
Oli
* Corrected: Plan wrongly copied earlier
[Updated on: Tue, 02 September 2008 07:45] Report message to a moderator
|
|
|