I have performance issue with the query which takes 5-10 mins and has table has very less number of records something arround a million records.I need to insert the filtered data into a global temp table.
Code:
SELECT PR.PAT_SEQ,
Q1.PROBLEM_DESCRIPTION,
FROM USR_TBL_SBART_B_PAT_RESULTS PR,
(SELECT P.PAT_SEQ,
HVS.PROBLEM_DESCRIPTION
FROM hhs_problem_aud_vw HVS,
USR_TBL_SBART_B_PATIENTS P
WHERE HVS.CPI_SEQ = P.CPI_SEQ ) Q1
WHERE Q1.PAT_SEQ(+) = PR.PAT_SEQ GROUP BY PR.PAT_SEQ,
Q1.PROBLEM_DESCRIPTION,
;
Comment