Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 30 Nov 2004 @ 21:43:03 GMT


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


Subj:   Dates not hashing evenly
 
From:   Geoffrey Rommel

As you know, dates are stored internally as integers. Also, a series of consecutive dates contains gaps if we view the dates as integers. For instance, the sequence of "consecutive" dates 2003-12-30 through 2004-01-02 is actually the sequence

     1031230
     1031231  /* gap here */
     1040101
     1040102

and, of course, there are similar gaps elsewhere between months.

Now, if we use a date as the primary index, the distribution turns out to be less even than we might like. I defined a table with a date as the primary index and stored twenty years' worth of consecutive dates in it. The ratio max(CurrentPerm)/avg(CurrentPerm) is near 1.0 for our better tables, but for this table it is 1.26.

Now my question. Is this simply an unavoidable consequence of the gaps in the integer sequence, or might there be some way to make the hashing of dates as even as that of integers?



     
  <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: 27 Dec 2016