Hi Expert DBAs,
I am facing an issue with a query, can anyone help me through?
I have a Query:
UPDATE VMUS.MSG_MSTR a SET MSG_STA_ID =5
WHERE a.PROC_ID =2 AND
a.file_type_id =1 AND
MSG_STA_ID IN (1, 3) AND
DATA_REQ_DT IS NOT NULL
We have 2 indexes for the table:
Indname Column names
XEM0602 +MSG_STA_ID+FIL E_TYPE_ID+PROC_ ID
XEM0605 +PROC_ID+FILE_T YPE_ID+SOURCE_F ILE_NM_TX
Query is using XEM0605 index, but I would like query to use index
XEM0602 which would be more economical. Please suggest a way to
achieve this.
I tried tweaking the sysstat tables no success. Also tried putting
query as
UPDATE VMUS.MSG_MSTR a SET MSG_STA_ID =5
WHERE a.MSG_STA_ID IN (1, 3) AND
a.PROC_ID =2 AND
a.file_type_id =1 AND
DATA_REQ_DT IS NOT NULL
No success.
If instead of the clause , " MSG_STA_ID IN (1, 3) " , I change to
MSG_STA_ID = 1 in UPDATE query optimizer uses my required index
"XEM0602". But for the IN clause it just disregards the field.Please
help.
An early response is well appreciated as issue is holding jobs.
Thanks for your time. ....
Regards
V
------------------------------------------------------------------------
IT Interview Questions :
http://www.geekinterview.com IT Tutorials and Articles :
http://www.geekarticles.com Oracle and Oracle Apps Training :
http://www.exforsys.com