Home » RDBMS Server » Performance Tuning » parallel_index (11g1, 11g2 LINUX)
parallel_index [message #532600] Wed, 23 November 2011 10:03 Go to next message
mjm22
Messages: 54
Registered: January 2010
Location: Singapore
Member
Hi

I have a large cdr_unbilled table (7M recs) that is joined to a much larger one cdr_data (60M recs) using an index. I must read every record of the smaller table, code below (The actual code is larger than this excerpt, but the theory of the problem remains the same with this code, I have tested).

SELECT --+ parallel_index(cu,8) index(cd)
       cd.external_id cli
      ,cd.element_id
      ,cd.type_id_usg
      ,cd.trans_dt
      ,cd.primary_units
      ,cd.unrounded_amount
  FROM cdr_data cd
      ,cdr_unbilled cu 
WHERE cd.msg_id=cu.msg_id
    and cd.msg_id2=cu.msg_id2  
    and cd.msg_id_serv=cu.msg_id_serv
    and cd.split_row_num = cu.split_row_num;


Now, i have this code in two systems. each system has roughly the same number of records in each table and the same indexes and table structure. The only difference is the Oracle version. 11.1.07 vs 11.2.02.

In the 11.1.07 database, the explain plan looks as I would expect (shown below)
SELECT STATEMENT  ALL_ROWSCost: 34 M  Bytes: 64 G  Cardinality: 946 M  						
	8 PX COORDINATOR  					
		7 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10000 :Q1000				
			6 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1000			
				4 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1000Cost: 34 M  Bytes: 64 G  Cardinality: 946 M  		
					2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1000	
						1 INDEX FAST FULL SCAN INDEX (UNIQUE) PARALLEL_COMBINED_WITH_PARENT ARBOR.CDR_UNBILLED_PK :Q1000Cost: 11 K  Bytes: 122 M  Cardinality: 9 M  
					3 INDEX RANGE SCAN INDEX (UNIQUE) PARALLEL_COMBINED_WITH_PARENT ARBOR.CDR_DATA_PK :Q1000Cost: 3  Cardinality: 1  	
				5 TABLE ACCESS BY INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT ARBOR.CDR_DATA :Q1000Cost: 4  Bytes: 6 K  Cardinality: 111  	


Yet in the 11.2.02 system I get the below. Notice there is no parallel processing here.
Plan
SELECT STATEMENT  ALL_ROWSCost: 29 M  Bytes: 68 G  Cardinality: 968 M  			
	5 NESTED LOOPS  		
		3 NESTED LOOPS  Cost: 29 M  Bytes: 68 G  Cardinality: 968 M  	
			1 TABLE ACCESS FULL TABLE ARBOR.CDR_UNBILLED Cost: 8 K  Bytes: 112 M  Cardinality: 7 M  
			2 INDEX RANGE SCAN INDEX (UNIQUE) ARBOR.CDR_DATA_PK Cost: 3  Cardinality: 1  
		4 TABLE ACCESS BY INDEX ROWID TABLE ARBOR.CDR_DATA Cost: 4  Bytes: 8 K  Cardinality: 132  	


Only when I alter the query to force a Fast Full Scan using the index_ffs on CDR_UNBILLED does my Plan from 11.2.02 match 11.1.07

      SELECT --+ parallel_index(cu,8)  index_ffs(cu,cdr_unbilled_pk) index(cd)
       cd.external_id cli
      ,cd.element_id
      ,cd.type_id_usg
      ,cd.trans_dt
      ,cd.primary_units
      ,cd.unrounded_amount
  FROM cdr_data cd
      ,cdr_unbilled cu 
WHERE cd.msg_id=cu.msg_id
    and cd.msg_id2=cu.msg_id2  
    and cd.msg_id_serv=cu.msg_id_serv
    and cd.split_row_num = cu.split_row_num;


returned plan:

Plan
SELECT STATEMENT  ALL_ROWSCost: 29 M  Bytes: 68 G  Cardinality: 968 M  						
	8 PX COORDINATOR  					
		7 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10000 :Q1000				
			6 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1000			
				4 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1000Cost: 29 M  Bytes: 68 G  Cardinality: 968 M  		
					2 PX BLOCK ITERATOR PARALLEL_COMBINED_WITH_CHILD :Q1000	
						1 INDEX FAST FULL SCAN INDEX (UNIQUE) PARALLEL_COMBINED_WITH_PARENT ARBOR.CDR_UNBILLED_PK :Q1000Cost: 9 K  Bytes: 112 M  Cardinality: 7 M  
					3 INDEX RANGE SCAN INDEX (UNIQUE) PARALLEL_COMBINED_WITH_PARENT ARBOR.CDR_DATA_PK :Q1000Cost: 3  Cardinality: 1  	
				5 TABLE ACCESS BY INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT ARBOR.CDR_DATA :Q1000Cost: 4  Bytes: 8 K  Cardinality: 132  		


I cannot explain why the code on the 11.2.02 system is performing a full table scan (without the additional ffs hint). I am assuming that this is due to the way the database has been configured but would like to know for sure. I am also aware that there were some changes to parallel_index in 11g2, the below is taken from the What's new Section of the SQL Reference for 11g2.

Quote:

Beginning with Oracle Database 11g Release 2, the PARALLEL, PARALLEL_INDEX, NO_PARALLEL, and NO_PARALLEL_INDEX hints are statement-level hints and supersede the earlier object-level hints


[Updated on: Wed, 23 November 2011 10:52] by Moderator

Report message to a moderator

Re: parallel_index [message #533932 is a reply to message #532600] Thu, 01 December 2011 14:05 Go to previous message
LNossov
Messages: 318
Registered: July 2011
Location: Germany
Senior Member
I don't think, your issue is a PQ issue. The cost of FTS is 8K, what is less than the cost of index FFS, that equals 9K. You have to compare the parameter settings and the optimizer stats on 11.1 and on 11.2.
Previous Topic: I/O issue
Next Topic: urgent please modify this query frenz sloww performance
Goto Forum:
  


Current Time: Sun Nov 24 12:55:12 CST 2024