Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 03 May 2012 @ 14:28:06 GMT


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


Subj:   Re: Surrogate key is defined on the index column
 
From:   Anomy Anom

<-- Anonymously Posted: Thursday, May 03, 2012 08:17 -->

Hi Sughesh,

Defining a surrogate key doesn't make the query better. The optimizer looks at the query and your table vitals, and then decides a best plan to get the data. If the query is on the PI, then it will got for a single-AMP operation. But if you are querying on some columns other than the PI, it may not go for a single or multiple AMP operation. Like someone already mentioned, even if you have USI or NUSI defined, you cannot expect the optimizer to go by our wish. Unlike other databases, you cannot hint Teradata to think in your way of getting the data.

That said, defining a unique value (sometimes surrogate keys or identity columns) will help in getting an uniform distribution of data, but beware of how you plan to access the data. If you define a surrogate key just to distribute the data and never use it in any sql, then you can never expect a single amp operation.


Thanks.



     
  <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