Home Page for the TeradataForum
 
https:

Archives of the TeradataForum

Message Posted: Tue, 24 Dec 2001 @ 18:28:29 GMT


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


Subj:   Re: Sequences in Teradata?
 
From:   Michael Larkins

Hi Charles:

I am familiar with this aspect of Oracle, so I am guessing the the "SEQUENCES" is a function that does 1 of 2 things:

1. It might generate a sequential number for use by the INSERT to provide a unique number to use as a primary key (unique and must have a value).

Teradata does not require a primary key nor a unique value for use as a primary index. As a result, it is far less necessary to generate system keys. Therefore, on the insert, there is no function to do this.

If you insist on a unique sequential value, is it possible to simply use up to 16 of your columns to define a UPI?

If not, then you can generate the number using MLOAD at data load time. It contains a scripting language that allows math (+1) to a variable (accumulator). You can even set it up to accept the starting value at run time.

2. It might sequence or sort the input data for loading as a primary key which must be sorted. If this is it, don't even consider sorting the data. Teradata's load utilities have a better chance of great performance if the incoming data is not sorted. This is especially true when duplicate primary index values are allowed. The reason is based on the fact that all the records with the same value go to the same AMP at the same time. It is better to send them at different points in the load instead of all at once based on resource utilization.

If I am incorrect on both of my assumption as to what SEQUENCES provides, please contact me and we can determine alternatives for you.

I hope this helps and best regards for the holidays,

Mike



     
  <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: 28 Jun 2020