Why choosing the right partitioning key is important
为何选择正确的分区键如此重要
The partitioning key definition cannot be altered.
分区键的定义不能修改。
A partitioning key should include one to three columns.
一个分区键应该包括一至三个列。
Unnecessary columns should not be included in the partitioning key.
分区键中不应该包括不必要的列。
Usually the table partitioning key will be a time-based column.
通常表分区键是基于时间的列。
An inappropriate partitioning key can cause uneven data distribution.
不恰当的分区键可能导致数据分布不均匀。
Choosing the right partitioning key is critical for two reasons.
选择正确的分区键之所以如此关键,有两方面的原因。
A partitioning key is defined on a table with the CREATE table statement.
分区键是在一个表上用CREATEtable语句定义的。
In addition, the partitioning key must still be based on relational data.
另外,分区键仍然必须基于关系数据。
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
如下的规则和建议适用于分区键定义
TP will only benefit those queries that include the table partitioning key column.
TP只对那些包括表分区键列的查询有利。
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.
对于被合并的表的分区键内的每列,必须存在一个同等连接的谓语。
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.
在这些情况下,建议您基于数据平衡选择分区键。
The partitioning key should include the columns that are used most often as predicates in queries.
分区键应该将最常使用的列作为谓词包含在查询中。
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.
整型分区键要比字符键高效,而字符键又比小数键高效。
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),后者被注释掉了。
应用推荐