View previous topic :: View next topic
|
Author |
Message |
sankar_MF
New User
Joined: 19 Sep 2006 Posts: 29
|
|
|
|
For this condition, there are around 600000 records available in the table.
This query takes more than 1 hour to complete.
Can any please tell me , how to optimize the following query to improve its performance.
Code: |
SELECT B.CUST_ID
, A.ADR_HOME
FROM PROD.TABLE1 A,
PROD.TABLE2 B
WHERE A.ADR_FMT = 'EMAIL'
AND A.ZIP5_CDE = ' '
AND B.ADDR_TYPE = 'EMAIL'
AND A.ZIP5_CDE = B.ZIP5_CDE
AND A.ADR_ID = B.ADR_ID
WITH UR
; |
Thanks
Sankar |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Little or nothing exact can be offered without an EXPLAIN.
By the way db2 tables have ROWs not RECORDs.
There are plenty of Threads on Explain, use the search facility. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
A.ZIP5_CDE is checked for spaces .. and you are using this column to join ??? Post the table indices .... o/p of EXPLAIN .... |
|
Back to top |
|
|
|