【问题标题】:Where do temporary tables get stored in a GreenPlum database?临时表存储在 GreenPlum 数据库中的什么位置?
【发布时间】:2018-07-05 14:01:03
【问题描述】:

在 MS SQL Server 中,临时表存储在tempdb Database

GreenPlum 中是否有类似的特殊位置用于临时表?还是只是存储在当前数据库和架构中的临时表,我在其下进行正常事务?

【问题讨论】:

    标签: temp-tables greenplum


    【解决方案1】:

    Greenplum 中的临时表存储在创建它们的数据库中,但是在一个临时模式中,该模式在创建表的会话期间存在。

    [gpadmin@mdw:~] $ createdb temp
    [gpadmin@mdw:~] $ psql temp
    temp=# create temporary table test_temp(a int) distributed by (a);
    CREATE TABLE
        Time: 50.516 ms
        temp=# \d
                         List of relations
           Schema   |   Name    | Type  |  Owner  | Storage
        ------------+-----------+-------+---------+---------
         pg_temp_11 | test_temp | table | gpadmin | heap
        (1 row)
    
    temp=# \dn
           List of schemas
            Name        |  Owner
    --------------------+---------
     gp_toolkit         | gpadmin
     information_schema | gpadmin
     pg_aoseg           | gpadmin
     pg_bitmapindex     | gpadmin
     pg_catalog         | gpadmin
     pg_temp_11         | gpadmin
     pg_toast           | gpadmin
     pg_toast_temp_11   | gpadmin
     public             | gpadmin
    (9 rows)
    
    temp=#
    
    temp=# \q
    
    [gpadmin@mdw:~] $ psql temp
    Timing is on.
    psql (8.3.23)
    Type "help" for help.
    
    temp=# \d
    No relations found.
    temp=# \dn
           List of schemas
            Name        |  Owner
    --------------------+---------
     gp_toolkit         | gpadmin
     information_schema | gpadmin
     pg_aoseg           | gpadmin
     pg_bitmapindex     | gpadmin
     pg_catalog         | gpadmin
     pg_toast           | gpadmin
     public             | gpadmin
    (7 rows)
    
    temp=#
    

    这是否回答了您的问题?

    【讨论】:

    • 非常感谢。您的回答是无价的,因为谷歌搜索并没有为我提供您在此处发布的信息。它总是以 pg_ 开头并包含一个 temp 吗?尽管在该临时表应该仍然存在的位置放置了一个断点,但我仍在努力寻找我在继承的源代码中看到的临时表。我正在使用psqlgpadmin,就像您发布的示例一样。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-09-07
    • 1970-01-01
    • 1970-01-01
    • 2010-10-15
    • 1970-01-01
    • 2023-03-20
    • 1970-01-01
    相关资源
    最近更新 更多