Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 20 Apr 2012 @ 19:57:41 GMT


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


Subj:   Re: Use of Negative Values Instead of NULL
 
From:   Anderson, Dirk

We've had some success on reducing skewing on LEFT OUTER JOINS by using negative values for non-matching numeric foreign keys instead of nulls.

Example of assignment:

     Coalesce (  , -1 * hashamp(  ))

Perhaps you could utilize the RANDOM function to assign non-numeric values in a random way that would result in somewhat even distribution for non-numeric keys. Example:

     SEL 'abcdefghijklmnopqrstuvwxyz0123456789' AS char_pool
     ,SUBSTR(char_pool,RANDOM(1,36),1)||SUBSTR(char_pool,RANDOM(1,36),1)||SUBSTR(
     char_pool,RANDOM(1,36),1)||SUBSTR(char_pool,RANDOM(1,36),1)||SUBSTR(char_poo
     l,RANDOM(1,36),1) AS char5_random_key

Thanks.

Dirk Anderson
SVP, Manager of Architecture & Strategy
Bank of America



     
  <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: 23 Jun 2019