Home » RDBMS Server » Performance Tuning » Query (Oracle 9i)
Query [message #468668] Sun, 01 August 2010 01:56 Go to next message
ramesh55.sse
Messages: 262
Registered: December 2008
Location: Hyderabad
Senior Member
Hi All,
How can we improve the perforamnce of this query ,it is taking nearly 1hr 30m , and this query retrieving 2000 records only.
Please help me on this.


SELECT Z.ID , Z.PTS , Z.DI FROM
( SELECT
A.ID ,
NVL(
( SELECT 'Y' FROMPS@ABC.world E
WHERE E.CD= A.CD
AND E.ID = A.ID
AND EXISTS ( SELECT 'X' FROM
PS@ABC.world J
WHERE E.ID = J.DEPTID
AND J.EMPL_STATUS IN
('A','L','P') AND J.EMPL_RCD = 0)),'N') PT,
NVL(
( SELECT 'Y'
FROMPS@ABC.world F , PS_JOBCODE_TBL@ABC.world JC
WHERE F.EMPL_RCD =A.EMPL_RCD
AND F.ID = A.ID
AND F.SETID_JOBCODE = JC.SETID
AND F.JOBCODE = JC.JOBCODE
AND JC.EFFDT =
( SELECT MAX(JC1.EFFDT) FROM PS_JOBCODE_TBL@ABC.world JC1
WHERE JC1.SETID = JC.SETID
AND JC1.JOBCODE = JC.JOBCODE
AND JC1.EFFDT <= SYSDATE)
AND (EXISTS ( SELECT 'X' FROMPS@ABC.world J1
WHERE F.ID = J1.DEPTID
AND J1.EMPL_STATUS IN ('A','L','P') AND J1.EMPL_RCD = 0) OR (JC.MANAGER_LEVEL = '65'))),'N')
DI FROMPS@ABC.world A
WHERE A.EMPL_STATUS IN ('A','L','P') AND A.EMPL_RCD = 0) Z

Thanks in advance.
Re: Query [message #468669 is a reply to message #468668] Sun, 01 August 2010 01:57 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
How can we improve the perforamnce of this query

It might be possible.

Regards
Michel
Re: Query [message #468692 is a reply to message #468669] Sun, 01 August 2010 10:58 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Thread: HOW TO: Post a SQL statement tuning request - template posting
http://forums.oracle.com/forums/thread.jspa?threadID=863295
Re: Query [message #468730 is a reply to message #468692] Sun, 01 August 2010 22:05 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Try a DRIVING_SITE hint

Ross Leishman
Re: Query [message #468743 is a reply to message #468730] Mon, 02 August 2010 00:46 Go to previous message
rahulvb
Messages: 924
Registered: October 2009
Location: Somewhere Near Equator.
Senior Member
Can you please Copy and post the Explain plan of this Query?

Explain plan


   set pagesize 25
   set linesize 121

   EXPLAIN PLAN FOR
   < Your Query >;


    SELECT * FROM TABLE(dbms_xplan.display);


Previous Topic: Table Partition
Next Topic: Need help with shared pool sizing
Goto Forum:
  


Current Time: Sat May 04 04:29:40 CDT 2024