我要为我的项目执行以下查询:
SELECT fcr.request_id,
DECODE
(fcpt.user_concurrent_program_name,
'Report Set', fcr.description,
'Request Set Stage', fcr.description,
fcpt.user_concurrent_program_name
) user_concurrent_program_name,
fcr.description, fcr.argument_text, fcr.concurrent_program_id,
fcr.parent_request_id, fcr.actual_start_date,
fcr.actual_completion_date,
ROUND ( (fcr.actual_completion_date - fcr.actual_start_date)
* 24
* 60,
4
) runtime,
DECODE (fcr.phase_code, 'C', 'No Schedule') program_status,
fu.user_name, frt.responsibility_name, fcr.logfile_name
FROM apps.fnd_concurrent_requests@db_link fcr,
apps.fnd_concurrent_programs_tl@db_link fcpt,
apps.fnd_user@db_link fu,
apps.fnd_responsibility_tl@db_link frt
WHERE fcr.concurrent_program_id = fcpt.concurrent_program_id
AND fcr.requested_by = fu.user_id
AND fcr.responsibility_id = frt.responsibility_id
AND fcr.responsibility_application_id = frt.application_id
AND fcr.actual_completion_date >= (SELECT MAX (alert_logged_time)
FROM allen.main_table
WHERE program_status = 'No Schedule')
AND fcr.phase_code = 'C';
但是上面的查询需要很长时间才能运行。当我给出相应的时间作为输入时,而不是
SELECT MAX (alert_logged_time)
FROM allen.main_table
WHERE program_status = 'No Schedule'
我什至很快就得到了输出。为什么呢?无论如何要纠正这个?