about update perform [message #296574] |
Mon, 28 January 2008 05:29 |
zxx2403
Messages: 13 Registered: November 2006 Location: china
|
Junior Member |
|
|
DateBase oracle 9.12
----------------------------------------------------------------
I have three table
ITRN_HIS the count : 2210755
C_SOQID the count : 10876
C_SOQMD the count : 158
---------------------------------------------------------------
The update Sql as follow:
-----------------------------------------------------------------
UPDATE ITRN_HIS
SET USER_ALPHA3 = SUBSTR(RPAD(USER_ALPHA3, 15, ' '), 1, 15) || 'Y' || SUBSTR(USER_ALPHA3, 17)
WHERE SOURCE = 5
AND SOURCE_QUAL = 5
AND CCN = 'PASDL'
AND MAS_LOC = 'PRO'
AND USER_ALPHA3 <> ' '
AND NVL(SUBSTR(USER_ALPHA3, 16, 1), ' ') <> 'Y'
AND
(POSTING_DATE BETWEEN TO_DATE('20080101', 'YYYYMMDD') AND TO_DATE('20080131', 'YYYYMMDD'))
AND
USER_ALPHA3 IN
(SELECT SUBSTR(C_SOQMD_INVOICE, 1, 15) FROM C_SOQMD WHERE TRIM(C_SOQMD_INVOICE) <> 'LAST')
AND EXISTS (SELECT *
FROM C_SOQID
WHERE INVOICE = SUBSTR(ITRN_HIS.USER_ALPHA3, 1, 15)
AND SO = ITRN_HIS.REF
AND SO_LINE = ITRN_HIS.REF_LINE)
---------------------------------------------------------------
The sql execute is very slow
What can I do.
Thank you very much
|
|
|
|
Re: about update perform [message #296586 is a reply to message #296574] |
Mon, 28 January 2008 06:01 |
zxx2403
Messages: 13 Registered: November 2006 Location: china
|
Junior Member |
|
|
zxx2403 wrote on Mon, 28 January 2008 05:29 | DateBase oracle 9.12
----------------------------------------------------------------
I have three table
ITRN_HIS the count : 2210755
C_SOQID the count : 10876
C_SOQMD the count : 158
---------------------------------------------------------------
The update Sql as follow:
UPDATE ITRN_HIS
SET USER_ALPHA3 = SUBSTR(RPAD(USER_ALPHA3, 15, ' '), 1, 15) || 'Y' || SUBSTR(USER_ALPHA3, 17)
WHERE SOURCE = 5
AND SOURCE_QUAL = 5
AND CCN = 'PASDL'
AND MAS_LOC = 'PRO'
AND USER_ALPHA3 <> ' '
AND NVL(SUBSTR(USER_ALPHA3, 16, 1), ' ') <> 'Y'
AND
(POSTING_DATE BETWEEN TO_DATE('20080101', 'YYYYMMDD') AND TO_DATE('20080131', 'YYYYMMDD'))
AND
USER_ALPHA3 IN
(SELECT SUBSTR(C_SOQMD_INVOICE, 1, 15) FROM C_SOQMD WHERE TRIM(C_SOQMD_INVOICE) <> 'LAST')
AND EXISTS (SELECT *
FROM C_SOQID
WHERE INVOICE = SUBSTR(ITRN_HIS.USER_ALPHA3, 1, 15)
AND SO = ITRN_HIS.REF
AND SO_LINE = ITRN_HIS.REF_LINE)
The sql execute is very slow
What can I do.
Thank you very much
|
|
|
|
|