The table distribution key and its role in a multipartitioned environment
The table distribution key is another element that can influence the distribution of table rows across existent partitions defined in a database partition group. Distribution keys can be created explicitly using DISTRIBUTION BY HASH
(columns) directive inside table definition or they can be defined implicitly by DB2 using a series of column rules detailed in this recipe. Usually distribution column might be designed and used to improve query performance.
Getting ready
This recipe is strongly correlated with the preceding one; here, we will also use before and after pictures of how the data is distributed across database partitions.
How to do it...
For some of the queries, we will use Command Editor, because it offers better visibility.
Using the command line
To find the distribution key columns for the
COMM
table, issue the following command:[db2instp@nodedb21 ~]$ db2 "select name from sysibm.syscolumns where tbname='COMM...