Archives of the TeradataForum
Message Posted: Thu, 03 May 2012 @ 14:28:06 GMT
<-- Anonymously Posted: Thursday, May 03, 2012 08:17 -->
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.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 23 Jun 2019|