The DBC.TableSizeV contains information that can help identify skewed tables. Table skew results from an inappropriate primary index. A query that references a skewed table may try to process more rows on some AMPs than others, and may run out of space:
1 Use the following SQL statement to find skewed tables in the DBC.TableSizeV:
SELECT vproc AS
"AMP", TableName (FORMAT 'X(20)'), CurrentPerm
FROM DBC.TableSizeV
WHERE DatabaseName = 'database'
ORDER BY TableName, "AMP" ;
AMP
---
0
1
2
3
0
1
2
3
|
TableName
---------------------
employee_upi_onempid
employee_upi_onempid
employee_upi_onempid
employee_upi_onempid
employee_nupi_ondept
employee_nupi_ondept
employee_nupi_ondept
employee_nupi_ondept
|
CurrentPerm
------------
18,944
18,944
18,944
19,968
4,096
30,208
15,360
12,288
|
In this example, the answer set displays space allocations by AMP for two tables. The results show that:
2 Redefine the primary index for any skewed tables that you find. See “Choosing a Primary Index” on page 63.