Unnecessary columns should not be included in the partitioning key.
分区键中不应该包括不必要的列。
Choosing the right partitioning key is critical for two reasons.
选择正确的分区键之所以如此关键,有两方面的原因。
The partitioning key should include the most frequently joined columns.
分区键应该包括最常连接的列。
A partitioning key consists of one or more columns defined at table creation.
一个分区键由在表创建时定义的一个或多个列组成。
Have the corresponding columns of the partitioning key be partition compatible.
分区键的相应列是分区兼容的。
The following rules and recommendations apply to the partitioning key definition
如下的规则和建议适用于分区键定义
In a non-partitioned database, no partitioning key or partitioning map is required.
在一个非分区数据库中,不需要分区键或分区映射。
Choose the right initial partitioning key (PK) prior to defining and populating a table.
在定义和填充一个表之前,选择正确的初始分区键(PK)。
The columns used in this definition are referred to as the table partitioning key columns.
该定义中使用的列被称为表分区键列。
You should bear mind of the following considerations when choosing a partitioning key.
在选择分区键时,应该注意以下几点。
For each column in the partitioning key of the joined tables, an equijoin predicate must exist.
对于被合并的表的分区键内的每列,必须存在一个同等连接的谓语。
One of the recommendations shown for the LINEITEM table is to change the hash partitioning key.
关于lineitem表的一个建议是更改hash分区键。
The partitioning key should be made up of columns that often participate in a GROUP BY clause.
分区键应该由常用于GROUP BY子句的列组成。
In such cases, it is recommended that you choose a partitioning key based on even data balancing.
在这些情况下,建议您基于数据平衡选择分区键。
When you use the partitioning key in the join predicate, a final consideration needs to be mentioned.
如果在连接谓词中使用分区键(partitioning key),最后还有一点考虑需要顾及。
The partitioning key should include the columns that are used most often as predicates in queries.
分区键应该将最常使用的列作为谓词包含在查询中。
The resolution is to ensure that a partitioning key is defined for the table before a load takes place.
其解决方案就是确保在加载表之前,为该表定义一个分区键(partitioning key)。
This example tests the data skew in a scenario in which the partitioning key was changed to S_NATIONKEY.
这个示例测试的是分区键被更改为S_NATIONKEY的场景中的数据倾斜。
The primary key and any unique index of the table must be a superset of the associated partitioning key.
表的主键和所有惟一索引都必须是相关分区键的超集。
The partitioning key cannot be more than 16 columns, but fewer columns result in better performance.
分区键不能多于16 个列,列数越少导致的性能就越好。
The cost of applying the partitioning hash algorithm is proportional to the size of the partitioning key.
应用分区散列算法的代价与分区键的规模成比例。
An integer partitioning key is more efficient than a character key, which is more efficient than a decimal key.
整型分区键要比字符键高效,而字符键又比小数键高效。
If there is no partitioning key provided explicitly in the CREATE TABLE command, the following defaults are used.
如果在CREATETABLE命令内没有显式地提供分区键,那么就会使用如下的这些默认值。
This example tests the data skew in a scenario in which the partitioning key was changed from S_NATIONKEY to S_ID.
这个示例测试的是分区键从 S_NATIONKEY 更改为 S_ID 的场景中的数据倾斜。
For TP, design decisions include selecting the column to use as the table partitioning key and number of partitions.
对于TP,设计决定包括选择用作表分区键的列和分区的数量。
Note that a new partitioning key is recommended (L_ORDERKEY) to replace the current one (L_PARTKEY), which is commented out.
注意,这里建议了一个新的分区键(L_ORDERKEY),用以替代当前的分区键(L_PARTKEY),后者被注释掉了。
The group of columns specified make up the partitioning key for the table —see sidebar, "Choosing a table partitioning key."
指定的列组成表的分区键 —参见边栏 “选择表分区键”。
The hashing algorithm is applied to the value of the partitioning key, and generates a partition number between zero and 4095.
散列算法应用于分区键的值,产生 0 到 4095之间的一个分区号。
The partitioning key should not include a column with unevenly distributed data or with a small number of distinct values.
分区键不应该包括没有将数据均匀分布或具有少数不同值的列。
In other words, all columns that are part of the partitioning key must be present in the primary key or unique index definition.
换句话说,作为分区键一部分的所有列都必须出现在主键或惟一索引定义中。
应用推荐