temporary tables Segment Allocation【每日一译】--20121128

Temporary tables use temporary segments. Unlike permanent tables, temporary tables
and their indexes do not automatically allocate a segment when they are created.
Instead, segments are allocated when the first INSERT (or CREATE TABLE AS
SELECT) is performed. This means that if a SELECT, UPDATE, or DELETE is performed

before the first INSERT, then the table appears to be empty.

临时表使用临时段。不像永久表,临时表和它们的索引不会自动分配一个段当它们被创建时。

取代的是,段在第一次INSERT(或者CTAS)执行时分配。这意味着如果一个SELECT,UPDATE,

或者DELETE在第一次INSERT前执行,那么这个表接近是空的。

You can perform DDL statements (ALTER TABLE, DROP TABLE, CREATE INDEX, and
so on) on a temporary table only when no session is currently bound to it. A session
gets bound to a temporary table when an INSERT is performed on it. The session gets
unbound by a TRUNCATE, at session termination, or by doing a COMMIT or ROLLBACK

for a transaction-specific temporary table.

你可以执行DDL语句(ALTER TABLE,DROP TABLE,CREATE INDEX等)在一个临时表上,

仅当当前没有会话绑定它。一个会话获得了绑定到一个临时表当一个INSERT在上面执行时。

会话通过一个TRUNCATE来解脱绑定,当会话中断,或者执行一个COMMIT或者ROLLBACK

对一个指定事务的临时表。

Temporary segments are deallocated at the end of the transaction for
transaction-specific temporary tables and at the end of the session for session-specific
temporary tables

临时段的回收在指定事务级别的临时表结束和在指定在会话级别的临时表结束。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值