I have the following SQL statement and explain results. This query is taking an excessive amount of time.
A couple questions:
1) does the use of LIKE still allow the optimizer to use an index?
2) the index it is using has policy_num, batch_date, batch_seq and seq_num. Sould I create a new index with just policy_num so this query will utilize it and perform faster?
Thanks!
Bob
SELECT ITEM.BATCH_DATE, ITEM.BATCH_SEQ, ITEM.SEQ_NUM, ITEM.POLICY_NUM,
ITEM.INSURED_NAME, ITEM.ITEM_TYPE_CODE, ITEM.EFFECTIVE_DATE,
ITEM.TRAN_EFFECT_DATE, ITEM.ITEM_PREMIUM, ITEM.ITEM_RETURNED, ITEM.ENTRY_SOURCE,
ITEM.NOTES_EXIST, ITEM.TAGS_EXIST, ITEM.REASONS_EXIST FROM ITEM ITEM WHERE
POLICY_NUM LIKE ? ESCAPE '+' ORDER BY ITEM.POLICY_NUM,ITEM.INSURED_NAME ASC
SQL4021 Access plan last saved on 09/22/09 at 15:20:19.
SQL4020 Estimated query run time is 27 seconds.
SQL4017 Host variables implemented as reusable ODP.
SQL4002 Reusable ODP sort used.
SQL4006 All indexes considered for table 1.
SQL4008 Index I1A30310 used for table 1.
SQL4011 Index scan-key row positioning used on table 1.