|
Archives of the TeradataForumMessage Posted: Sat, 29 Oct 2005 @ 09:11:37 GMT
Although Brian's book uses the select, it does not necessarily indicate that skew does not exist. It only provides a ratio of the total number of rows to the number of unique row hash values in the table. It does not tell you how the data is distributed. Actual distribution determines the existence or absence of skew. Even with a unique primary index a degree of skew can still exist. So, instead of this request: > select (count(*) (FLOAT)) / > count(DISTINCT HASHROW (col1, col2...coln)) from TableA; I have written one that looks like this: SELECT HASHAMP(HASHBUCKET(HASHROW(col1,col2...coln))) ,count(*) from table_name GROUP BY 1 ORDER BY 1; This will count the number of rows on each AMP and provides a more accurate perspective on the actual distribution of the data. It can also be used with one or more colunms from the table to test the distribution based on the actual data versus creation a new table, checking the current space utilization on each AMP, copying the data and then checking the space used after the copy. Hope this helps, Michael Larkins
| ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||