【问题标题】:How to find the column on which the table is organized in netezza?如何在netezza中找到组织表格的列?
【发布时间】:2014-09-25 07:45:36
【问题描述】:

我在 Netezza 中创建了如下表:

CREATE TABLE sample
( col1 int,
col2 int,
col3 int,
col4 int )
DISTRIBUTE ON HASH (col1,col2,col3)
ORGANIZE ON (col2);

创建表后,我想查询数据库以查找表在哪个列上“组织在”。由于上表是按 "col2"

组织的

【问题讨论】:

    标签: netezza


    【解决方案1】:

    要查找表的哪些列是organized on,您可以使用以下system table 查询之一。

    select *
    from _v_odbc_columns1
    where orgseqno is not null
    

    select *
    from _v_table_organize_column
    

    要查找表中的列distributed on

    select tablename, owner, attname as distribution_column
    from _v_table_dist_map
    

    如果表没有值则表分布在random;

    【讨论】:

    • 我想知道表格是在哪一列上“组织的”,而不是“分布在”上的。
    • 很抱歉在答案中添加了有组织的位。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-27
    • 2021-02-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-15
    相关资源
    最近更新 更多