绿色分布
有一个具有随机分布的表,
CREATE TABLE schema.table (
col1 int4 NULL,
col2 int4 NULL,
col3 int4 NULL
)
WITH (
appendonly=true,
compresstype=zstd,
orientation=column
)
DISTRIBUTED RANDOMLY;
我们需要在一个字段上最佳(最小偏斜)分配行。为此,我们可以创建测试表
CREATE TABLE schema.test_table (
col_1 int4 NULL,
col_2 int4 NULL,
col_3 int4 NULL
)
WITH (
appendonly=true,
compresstype=zstd,
orientation=column
)
DISTRIBUTED BY (col_i);
INSERT INTO schema.test_table SELECT * FROM schema.table;
,然后通过偏斜进行检查,例如,通过
select * from gp_toolkit.gp_skew_coefficient('schema.test_table'::regclass);
,问题是我们要在不创建测试表的情况下检查偏斜的表格。可以做到这一点,如果是的话,如何?
There is a table with a random distribution
CREATE TABLE schema.table (
col1 int4 NULL,
col2 int4 NULL,
col3 int4 NULL
)
WITH (
appendonly=true,
compresstype=zstd,
orientation=column
)
DISTRIBUTED RANDOMLY;
We need to optimally (with minimal skew) distribute rows over one field. For this we can create test tables
CREATE TABLE schema.test_table (
col_1 int4 NULL,
col_2 int4 NULL,
col_3 int4 NULL
)
WITH (
appendonly=true,
compresstype=zstd,
orientation=column
)
DISTRIBUTED BY (col_i);
INSERT INTO schema.test_table SELECT * FROM schema.table;
And then check them against skew, for example via
select * from gp_toolkit.gp_skew_coefficient('schema.test_table'::regclass);
The problem is that we want to check the table for skew without creating test tables. Can this be done, and if so, how?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您真的不想创建一个新表,那么这样的事情将起作用,但是我不知道在不实际(重新)分发数据的情况下建模分布的方法。
Something like this will work if you really do not want to create a new table, but I do not know of a way to model the distribution without actually (re)distributing the data.