Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: query taking time
Hi Raja,
i am just guessing the order of the columns in the index, you'll have to validate this
4. execute dbms_stats.gather_table_stats(user,'UNBILLED_REPORT',cascade=> true);
5. of course, test the re-written query below:
select
sum(charges),
count(acct#),
to_char(received_date, 'mm-dd-yyyy'),
to_char(received_date, 'hh24:mi')
from unbilled_report ub
where hospital_id = 'MENONITA'
and patient_case_type in
( select distinct pst.patient_case_type
from patient_case_type pst, him_patient_case_type hpst
where pst.hospital_id = 'MENONITA'
and hpst.himcode = pst.himcode
and hpst.patient_case_type = 'INP')
and received_date = (select max(received_date)
from unbilled_report
where hospital_id = 'MENONITA')
6. also see if you can use subquery factoring.
HTH,
-Arul
-- http://www.freelists.org/webpage/oracle-lReceived on Wed Oct 19 2005 - 01:21:38 CDT
![]() |
![]() |