Oracle Union Query very slow.
Posted on 2004-10-29
I have this oracle query which uses union to build a list from two tables. For some reason it is very slow.
Can anyone suggest some improvements [Other than changing the crappy server..:)]
there are two tables. FCLIENT and FSALE. FCLIENT has 13000+ records and FSALE has 70000+ records. I personally think Oracle should handle this pretty well, but it is very slow.
select C_SEQUENCE as SEQ, C_REC_NO as RECNO, C_FIRSTNAME_INTL as FIRSTNAME, C_SURNAME as LASTNAME, C_TELEPHONE as PHONE, C_DATE_INPUT as INPUTDATE, C_POSTAL_CODE as POSTAL, C_LANGUAGE as LANG, C_ORGANIZATION as ORGANIZATION, C_CITY as CITY,0 as TICKET ,'FCLIENT' as WHICHTABLE
from FCLIENT union
select FS_ORDER_NUM as SEQ, 0 as RECNO, FS_FNAME as FIRSTNAME, FS_LNAME as LASTNAME,
FS_TEL as PHONE, FS_DATE_INPUT as INPUTDATE, FS_POST_CODE as POSTAL, FS_LANGUAGE as LANG,
FS_COMPANY as ORGANIZATION, FS_CITY as CITY,FS_ORDER_NUM as TICKET,'FSALE' as WHICHTABLE