临时表存储在 GreenPlum 数据库的什么位置?
Where do temporary tables get stored in a GreenPlum database?
在 MS SQL 服务器中临时 table 存储在 tempdb Database。
GreenPlum 中是否有类似的临时 table 特殊位置?或者临时 table 只是存储在我进行正常交易的当前数据库和架构中?
Greenplum 中的临时 tables 存储在创建它们的数据库中,但存储在一个临时模式中,该模式在创建 table 的会话期间存在。
即
[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=#
这是否回答了您的问题?
在 MS SQL 服务器中临时 table 存储在 tempdb Database。
GreenPlum 中是否有类似的临时 table 特殊位置?或者临时 table 只是存储在我进行正常交易的当前数据库和架构中?
Greenplum 中的临时 tables 存储在创建它们的数据库中,但存储在一个临时模式中,该模式在创建 table 的会话期间存在。
即
[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=#
这是否回答了您的问题?