Home » RDBMS Server » Performance Tuning » Optimize my Query
Optimize my Query [message #556617] Tue, 05 June 2012 13:03 Go to next message
tarek_land
Messages: 3
Registered: June 2012
Location: Kuwait
Junior Member
SELECT b.KPCNO
         ,b.KPC_FULL_NAME    

FROM xxkpc_hr_personnel_v2  b
WHERE  b.type(+) = 'KPC Employee'
       AND b.DESIGNATION is null
       AND b.kpcno IS NOT NULL
       AND b.ORGANIZATION_ID=(select g.ORGANIZATION_ID from  xxkpc_fn_web_personnel_v g where g.kpcno = :kpcno)
GROUP BY b.KPCNO
          ,b.kpc_full_name

UNION

SELECT b.KPCNO
         ,b.KPC_FULL_NAME
FROM xxkpc_hr_pos_struct_code_comb   a
     ,xxkpc_hr_personnel_v2  b
WHERE b.position_id(+) = a.child_position_id
       AND b.type(+) = 'KPC Employee'
       AND b.kpcno IS NOT NULL
       AND a.PERANT_POSITION_ID =  (select g.POSITION_ID from  xxkpc_fn_web_personnel_v g where g.kpcno = :kpcno)
GROUP BY b.KPCNO
          ,b.kpc_full_name
Re: Optimize my Query [message #556619 is a reply to message #556617] Tue, 05 June 2012 13:06 Go to previous message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Since NOBODY can optimize SQL just by looking at it, we need a few more details.
http://www.orafaq.com/forum/m/433888/136107/#msg_433888
Please refer to URL above & be sure to provide the details requested:
1) DDL for all tables & indexes
2) EXPLAIN PLAN
3) output from SQL_TRACE & tkprof
Previous Topic: block size
Next Topic: Oracle documentation on details of AWR report
Goto Forum:
  


Current Time: Thu Mar 28 05:00:35 CDT 2024