In this example, the SELECT request looks for poorly distributed tables by displaying the average, minimum, and maximum of the CurrentPerm figures allocated on each AMP to every table in the USER database. Each table is reported separately, ordered by name.
SELECT
TableName (FORMAT 'X(20)'),
MIN(CurrentPerm) AS "AMP Minimum",
AVG(CurrentPerm) AS "AMP Average",
MAX(CurrentPerm) AS "AMP Maximum"
FROM DBC.TableSizeV
WHERE DatabaseName = 'USER'
GROUP BY TableName
ORDER BY TableName;
TableName
--------------------
employee_nupi_ondept
employee_upi_onempid
|
AMP Minimum
-----------
4,096
18,944
|
AMP Average
------------
15,488
19,200
|
AMP Maximum
------------
30,208
19,968
|
The result displays two tables. Notice the results show that: