Evaluating for Primary Index

Database
N/A

Evaluating for Primary Index

Good morning,

I have a table that is highly skewed.  The currentperm per amp ranges from a high of  7,828,770,304  to a low of 1,762,582.528.  There are 42 amps on the system.

I would like to evaluate the data for a possible change to the primary index.

What is the best way to accomplish the evaluation?  Does Teradata have recommended queries for thi?

Thank you!

3 REPLIES
Teradata Employee

Re: Evaluating for Primary Index

select hashamp(hashbucket(hashrow(YOUR_COLUMN))), count(1) 
from YOUR_TABLE
group by 1

You can use the above query. YOUR_COLUMN can be replaced by a group of columns to test as a possible PI.

Teradata Employee

Re: Evaluating for Primary Index

With this query you'll get in advance the distribution by AMP if you use "YOUR_COLUMN" as PI

N/A

Re: Evaluating for Primary Index

Thank you so much