How to find No. of Records present in Each AMP or a Node for a given Table through SQL?

Tools
Enthusiast

How to find No. of Records present in Each AMP or a Node for a given Table through SQL?

How to find No. of Records present in Each AMP or a Node for a given Table through SQL?
4 REPLIES

Re: How to find No. of Records present in Each AMP or a Node for a given Table through SQL?

Sel HASHAMP(HASHBUCKET(HASHROW(PRIMARY_INDEX_COLUMNS))) AS AMP_NO,COUNT(*)
from DATABASENAME.TABLE_NAME
GROUP BY 1;

Thanks,
Sreedhar
Enthusiast

Re: How to find No. of Records present in Each AMP or a Node for a given Table through SQL?

Please check the 'sample scripts' sub-section in the chapter of Teradata manual on "Performance management"
There are lot of scripts there.

One example reproduced here...

/* The following query will provide the distribution by amp */
/* for a given index or column. */
/* */
sel hashamp(hashbucket(hashrow(index or column)))
,count(*)
from database.table
group by 1
order by 2 desc;
/* */
Enthusiast

Re: How to find No. of Records present in Each AMP or a Node for a given Table through SQL?

Thanks sreedhar,
Enthusiast

Re: How to find No. of Records present in Each AMP or a Node for a given Table through SQL?

thanks ramakrishna