DUMP_PROJECTION_PARTITION_KEYS
转储指定投影的分区键。
这是元函数。您必须在顶级 SELECT 语句中调用元函数。
行为类型
易变语法
DUMP_PROJECTION_PARTITION_KEYS( '[[database.]schema.]projection-name')
参数
-
[database.]schema
数据库和架构。默认架构为
public
。如果指定一个数据库,它必须是当前数据库。- projection‑name
- 投影名称
特权
非超级用户:对锚表的 TRUNCATE 权限
示例
下列语句将分别创建表和投影 online_sales.online_sales_fact
和 online_sales.online_sales_fact_rep
,并将按列 call_center_key
对表数据进行分区:
=> CREATE TABLE online_sales.online_sales_fact
(
sale_date_key int NOT NULL,
ship_date_key int NOT NULL,
product_key int NOT NULL,
product_version int NOT NULL,
customer_key int NOT NULL,
call_center_key int NOT NULL,
online_page_key int NOT NULL,
shipping_key int NOT NULL,
warehouse_key int NOT NULL,
promotion_key int NOT NULL,
pos_transaction_number int NOT NULL,
sales_quantity int,
sales_dollar_amount float,
ship_dollar_amount float,
net_dollar_amount float,
cost_dollar_amount float,
gross_profit_dollar_amount float,
transaction_type varchar(16)
)
PARTITION BY (online_sales_fact.call_center_key);
=> CREATE PROJECTION online_sales.online_sales_fact_rep AS SELECT * from online_sales.online_sales_fact unsegmented all nodes;
下列 DUMP_PROJECTION_PARTITION_KEYS 语句将转储投影 online_sales.online_sales_fact_rep
中的分区键:
=> SELECT DUMP_PROJECTION_PARTITION_KEYS('online_sales.online_sales_fact_rep');
Partition keys on node v_vmart_node0001
Projection 'online_sales_fact_rep'
Storage [ROS container]
No of partition keys: 1
Partition keys: 200
Storage [ROS container]
No of partition keys: 1
Partition keys: 199
...
Storage [ROS container]
No of partition keys: 1
Partition keys: 2
Storage [ROS container]
No of partition keys: 1
Partition keys: 1
Partition keys on node v_vmart_node0002
Projection 'online_sales_fact_rep'
Storage [ROS container]
No of partition keys: 1
Partition keys: 200
Storage [ROS container]
No of partition keys: 1
Partition keys: 199
...
(1 row)