|
|
Archives of the TeradataForum
Message Posted: Fri, 20 Apr 2012 @ 19:57:41 GMT
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
| |