Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 30 Dec 2003 @ 10:59:15 GMT


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


Subj:   Re: Identity Column Crisis
 
From:   Narayan Murthy

Batch Size is not the only factor to be consider it is also the attributes that you have provided for the Identity column and the number of amps.

Say you have a batch size of 100.

Start value =1
Increment value =1
Max value = 1000000
No cycle.
No of amps :  2

Amp0        : StartVal: 1
              Last val: 100
Amp1        : StartVal = 101
              Last Val = 200

So,

Amp0 will generate values from 1 to 100 (with increment of 1) once 100 is reached the next set of values from 201 to 300 is stored to be generated

Amp1 will generate values from 101 to 200(with increment of 1) once 200 is reached the next set of values from 301 to 400 is stored to be generated

So if you need performance, you could increase the batchsize and reduce the increment value so that more values are cached on the AMPs, this will reduce the number of times the AMPs would make a visit to the DBC table to fetch the next set of values.

But if you were to give a batch size of 1 , then for every value the amps would have to make a round about trip - which would around 1000 io operation were you to insert a 1000 rows - which is catestrophic. I do understand the need for a batch size of 1(to generate sequential values) but you are going to lose on performance.

May be you could try something like :

Number of amps=2
Numbers of rows to be inserted = 1000
- set the batch size = 500
- set the increment = 1

So each amp would generate :

Amp0 (1-500)
Amp1 (501-1000)

With an increment of 1. I guess this should give you the sequence you are looking for. And being performant oriented.

You could change the numbers above according to your configuration and the required number of rows.


Narayan.



     
  <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