Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 30 Jun 2003 @ 12:11:30 GMT


     
  <Prev Next>   <<First <Prev
Next>
Last>>
 


Subj:   Re: Primary keys
 
From:   Claybourne Barrineau

Jim,

Assuming the performance is acceptable, keeping things simplier is better 99% of the time.

I'd leave Table X's UPI as X_Id. For table XR, I'd change the PI to a UPI of (X_ID, Related_X_ID.) Changing the PI of XR to X_ID will only help in certain cases, and, as you verified, can result in skewing issues. Make sure you have individual statistics on both columns.

For fun, you can try creating a single-table JI on table XR with a NUPI on X_ID. Also, consider using RowID in this JI to see if the optimizer makes use of it. Remeber, you must collect stats on the JI's Primary Index inorder for the optimizer to consider it. Just like the base table, be sure to collect stats on all columns.


Hope this helps,

Clay



     
  <Prev Next>   <<First <Prev
Next>
Last>>
 
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023