[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference orarep::nomahs::rdb_60

Title:Oracle Rdb - Still a strategic database for DEC on Alpha AXP!
Notice:RDB_60 is archived, please use RDB_70..
Moderator:NOVA::SMITHISON
Created:Fri Mar 18 1994
Last Modified:Fri May 30 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:5118
Total number of notes:28246

4996.0. "From fast Cross[1:1] in V to slow zig-zag in V7" by NOMAHS::SECRIST (Rdb WWS; [email protected]) Tue Feb 04 1997 12:17

	Customer has a query that went from minutes under V4.0-2
	using cross blocks to hours under 7.0-0 using zig-zag.
	Application builds text and then executes query using
	dynamic SQL, but no source code available to introduce
	the use of a named query outline.  Tried adding an index
	to lead the optimizer down a different path, but kept
	using zig-zag.  Any ideas on a workaround ?  Does this
	need to be BUGged ?  Strategies follow.

	Regards,
	rcs
	
Note: although indexes are named differently between two queries
they are identically specified in both (personal inspection).

The query:

	SEL PID_GRP_RT.PID_GRP_CD, PID_GRP_RT.PID_GRP_NAME FROM
	PID_GRP_RT, PID_RT, PRODT_RT
	WHERE PID_GRP_RT.PID_GRP_CD = PID_RT.PID_GRP_CD
	AND PID_RT.PRODT_AGRGT_CD = PRODT_RT.PRODT_AGRGT_CD
	AND PRODT_RT.PRODT_ID = 'FR691ADWA';

The "good" strategy under V4.0-2:

	Cross block of 3 entries
	  Cross block entry 1
	    Get     Index only retrieval
	    Retrieval by index of relation PRODT_RT
	      Index name  PRODT_RT_IDX_5A [1:1]
	  Cross block entry 2
	    Leaf#01 FFirst PID_RT Card=8204
	      BgrNdx1 PID_RT_IDX_2B [1:1]
	  Cross block entry 3
	    Get     Retrieval by index of relation PID_GRP_RT
	      Index name  PID_GRP_RT_IDX_1A [1:1]    Direct tree lookup
	Solutions tried 0
	Solutions blocks created 0
	Created solutions pruned 0
	~E#0004.01(1) BgrNdx1 EofData  DBKeys=1  Fetches=3+0  RecsOut=1
	~E#0004.01(1) FgrNdx  FFirst   DBKeys=1  Fetches=0+1  RecsOut=1`ABA
	~E#0004.01(1) Fin     Buf      DBKeys=1  Fetches=0+0  RecsOut=1
	 PID_GRP_RT.PID_GRP_CD   PID_GRP_RT.PID_GRP_NAME
	 000185                  Intel PCs
	1 row selected
	
The "bad" strategy under V7.0:

	Conjunct 
	Match 
	  Outer loop 
	    Sort    Conjunct 
	    Match 
	      Outer loop      (zig-zag) 
	        Get     Retrieval by index of relation PID_GRP_RT
	          Index name  PID_GRP_RT_IDX_1 [0:0]
	      Inner loop      (zig-zag) 
	        Get     Retrieval by index of relation PID_RT
	          Index name  PID_RT_IDX_1B [0:0]
	  Inner loop      (zig-zag) 
	    Index only retrieval of relation PRODT_RT
	      Index name  PRODT_RT_IDX_6A [1:1]
	 PID_GRP_RT.PID_GRP_CD   PID_GRP_RT.PID_GRP_NAME          
	 000185                  Intel PCs                        
	1 row selected
	
    
T.RTitleUserPersonal
Name
DateLines
4996.1ukvms3.uk.oracle.com::PJACKSONOracle UK Rdb SupportTue Feb 04 1997 12:325
    What are the index definitions?
    
    What information has been collected on V7.0?
    
    Peter
4996.2Query went from minutes to a business day...NOMAHS::SECRISTRdb WWS; [email protected]Wed Feb 12 1997 09:3874
Is this bogus or what ?

	;    What are the index definitions?

Outside of a couple of unrelated indexes on different leading fields
not used in the query given in '.0, identical indexes are stipulated 
under both the V4.0-2 and V7.0 databases.  The index definitions used
are given on the left and the strategy chosen on the right (the
unexpurgated strategy is also in '.0).  The table data is identical
since they upgraded the application to V7.0.  The result however is
that the V4.0 query runs in minutes and the V7.0 query takes a full
business day.  Any ideas ?

V4.0-2:
		
PRODT_RT_IDX_5A 			Cross block 1, index only, [1:1]
  with column PRODT_ID
  and column PRODT_AGRGT_CD
  no duplicates allowed
  type is sorted
  Store clause: STORE in IDX_9

PID_RT_IDX_2B   			Cross block 2 FFirst BgrNdx1 [1:1]
  with column PRODT_AGRGT_CD
  and column PID_CD
  no duplicates allowed
  type is sorted
  Store clause: STORE in IDX_9

PID_GRP_RT_IDX_1A 			Cross block 3 FFirst BgrNdx1 [1:1]
  with column PID_GRP_CD
  no duplicates allowed
  type is sorted
  Store clause: STORE in IDX


V7.0:					Conjunct match outer loop
					  Sort Conjunct match outer loop
                                            Match
PID_GRP_RT_IDX_1     			      Outer loop zig-zag [0:0]
  with column PID_GRP_CD
  No Duplicates allowed
  Type is Sorted
  Compression is DISABLED
  Store clause: STORE in REF_IDX_4


PID_RT_IDX_1B        			      Inner loop zig-zag [0:0]
  with column PID_GRP_CD
  and column PID_CD
  Duplicates are allowed
  Type is Sorted
  Compression is DISABLED
  Store clause: STORE in REF_IDX_4

    
PRODT_RT_IDX_6A                             Inner loop zig-zag [1:1]
  with column PRODT_ID
  and column PRODT_AGRGT_CD
  No Duplicates allowed
  Type is Sorted
  Compression is DISABLED
  Store clause: STORE in REF_IDX_5

	;    What information has been collected on V7.0?

The same RDMS$DEBUG_FLAGS output was collected on both V4.0-2 and V7.0
and is provided in '.0.

Regards,
rcs

    
4996.3HOTRDB::LASTOVICAIs it possible to be totally partial?Wed Feb 12 1997 09:443
    I'd suggest creating a reproducable example that the optimizer-wise can
    run on our development machines and then BUG it.  I'm sure that there
    is, at least, a workaround.
4996.4To BUG or not to BUG yet -- that is my question !NOMAHS::SECRISTRdb WWS; [email protected]Sun Feb 23 1997 13:5814
    
    I have a reproduceable case of the fast cross to slow zig-zag
    and it behaves the same way under V5.1 and V7.0, but I have yet
    to find a V4.0 system or a V4.0 kit (since RDBKIT seems dead
    and I don't have a VAXstation to load it from CD) that I can 
    use to set up the comparison case.  Should I bug it like this
    or wait until I can personally prove the V4.0 case ?
    
    Regards,
    rcs
    
    P.S. -- the files are on the 'Springs test cluster at
    $1$DUA31:[RSECRIST.98562376].
    
4996.5HOTRDB::LASTOVICAIs it possible to be totally partial?Sun Feb 23 1997 14:4411
    >    P.S. -- the files are on the 'Springs test cluster at
    >    $1$DUA31:[RSECRIST.98562376].
    
    	Most people don't know what the springs test cluster would be. 
    Under the assumtion that it was available at PIKSPK::, I tried, but,
    alas, the files are protected against FAL access.
    
    	In any case, if it works the same from versions 5.1 through 7.0, I
    don't expect that this will be considered an exceptionally
    high-priority optimizer problem.  You might be better off spending time
    looking for workarounds.
4996.6Don't know that we go back that far anymore...BOUVS::OAKEYI'll take Clueless for $500, AlexSun Feb 23 1997 23:177
~~    <<< Note 4996.4 by NOMAHS::SECRIST "Rdb WWS; [email protected]" >>>
~~             -< To BUG or not to BUG yet -- that is my question ! >-

~~    to find a V4.0 system or a V4.0 kit (since RDBKIT seems dead

I'm not sure we have 4.0 kits anymore :)  (it's pretty old).

4996.7Whatever It Takes...NOMAHS::SECRISTRdb WWS; [email protected]Mon Feb 24 1997 09:2526
    
    re: .5
    
        ; Under the assumtion that it was available at PIKSPK::, I tried,
    	; but, alas, the files are protected against FAL access.
    
    You assumed correctly, and the files are now unprotected at
    PIKSPK""::$1$DUA31:[RSECRIST.98562376] if you're still interested.
    
    	; if it works the same from versions 5.1 through 7.0... You might
    	; be better off spending time looking for workaround.
    
    Understood, but it is curious that the V4.0 optimizer picks a better
    path than the V7.0 optimizer.  Now that I have a repeatable case
    though I intend to do just what you suggest though.
    
    Re: .6
    
    	; I'm not sure we have 4.0 kits anymore :)  (it's pretty old). 
    
    Thanks.  I have to try and find one because I'm always happy to
    help a customer who wants to upgrade to the current stuff !
    
    Regards,
    rcs
    
4996.8NOVA::SMITHIDon&#039;t understate or underestimate Rdb!Mon Feb 24 1997 10:538
Well I'd like to see a BUG report.  We need to know cases where the optimizer
chooses a poor path and try to understand why.

We await your BUG report too.

thanks,

Ian