A customer complained that a query and its INSERT counterpart
had different execution plans, and of course, the INSERT was
slower.
First lets look at the SELECT :
SELECT ua_tr_rundatetime,
ua_ch_treatmentcode,
ua_tr_treatmentcode,
ua_ch_cellid,
ua_tr_cellid
FROM (SELECT DISTINCT CH.treatmentcode AS
UA_CH_TREATMENTCODE,
CH.cellid AS
UA_CH_CELLID
FROM CH,
DL WHERE ...