Home » SQL & PL/SQL » SQL & PL/SQL » SQL ISSUE (oracle 11g / unix)
SQL ISSUE [message #619064] Thu, 17 July 2014 12:19 Go to next message
balaji123
Messages: 29
Registered: October 2009
Location: sanfrancisco
Junior Member
Hi,

Below sql get hangs with in large data set , both table has 10 million rows.
Smaller data set working fine . Please advise . How to resolve the issue.
Thanks in advance.
sql:

          SELECT maint.* FROM (
           SELECT 
                 th.*
             FROM trans_history th, events_que ceq 
            WHERE ceq.queue_id BETWEEN s_queue_id AND p_queue_id
                  AND ceq.stat = 'N'
                  AND th.flag = 'Y'
                  AND ceq.id = th.id
                  AND ceq.module = 'OPEN'
                  AND th.tdate < SYSDATE - ( t_mins_back / (24 * 60))  --> every 6 minutes based on sysdate 
         ORDER BY ceq.event_id ) maint 
         WHERE ROWNUM<= batch_size  



Explain plan:


Plan
SELECT STATEMENT  ALL_ROWSCost: 38  Bytes: 3,051  Cardinality: 9  					
	7 FILTER  				
		6 NESTED LOOPS  			
			4 NESTED LOOPS  Cost: 38  Bytes: 3,051  Cardinality: 9  		
				2 TABLE ACCESS BY INDEX ROWID TABLE EVENTS_QUE Cost: 11  Bytes: 216  Cardinality: 9  	
					1 INDEX RANGE SCAN INDEX CONSMREVNTSQUE_N6 Cost: 3  Cardinality: 17  
				3 INDEX UNIQUE SCAN INDEX (UNIQUE) NEW_UNIQUE_U1 Cost: 2  Cardinality: 1  	
			5 TABLE ACCESS BY INDEX ROWID TABLE TRANS_HISTORY Cost: 3  Bytes: 315  Cardinality: 1  		



*BlackSwan added {code} tags. Please do so yourself in the future.
please read http://www.orafaq.com/forum/t/174502/102589/

[Updated on: Thu, 17 July 2014 12:41] by Moderator

Report message to a moderator

Re: SQL ISSUE [message #619065 is a reply to message #619064] Thu, 17 July 2014 12:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68647
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

First, you must feedback in your previous topic.

Re: SQL ISSUE [message #619066 is a reply to message #619064] Thu, 17 July 2014 12:25 Go to previous messageGo to next message
Lalit Kumar B
Messages: 3174
Registered: May 2013
Location: World Wide on the Web
Senior Member
Please use code tags. And look at the sticky post on top of performance tuning forum. It has lost of information.

An unindented execution plan is of no use as it is impossible to know the execution steps in a particular order.

[Updated on: Thu, 17 July 2014 12:28]

Report message to a moderator

Re: SQL ISSUE [message #619068 is a reply to message #619066] Thu, 17 July 2014 12:33 Go to previous message
balaji123
Messages: 29
Registered: October 2009
Location: sanfrancisco
Junior Member
sure . Thanks.
Previous Topic: get every result of a query to use after other query
Next Topic: archive & Purge of table
Goto Forum:
  


Current Time: Fri Apr 26 17:39:53 CDT 2024