SQL Work Areas(101)

For complex queries (for example, decision-support queries), a big portion of the
runtime area is dedicated to work areas allocated by memory-intensive operators such
as the following:
■ Sort-based operators (order by, group-by, rollup, window function)
■ Hash-join
■ Bitmap merge
■ Bitmap create
For example, a sort operator uses a work area (sometimes called the sort area) to
perform the in-memory sort of a set of rows. Similarly, a hash-join operator uses a
work area (also called the hash area) to build a hash table from its left input. If the
amount of data to be processed by these two operators does not fit into a work area,
then the input data is divided into smaller pieces. This allows some data pieces to be
processed in memory while the rest are spilled to temporary disk storage to be
processed later. Although bitmap operators do not spill to disk when their associated
work area is too small, their complexity is inversely proportional to the size of their
work area. Thus, these operators run faster with larger work area.
The size of a work area can be controlled and tuned. Generally, bigger database areas
can significantly improve the performance of a particular operator at the cost of higher
memory consumption. Optimally, the size of a work area is big enough such to
accommodate the input data and auxiliary memory structures allocated by its
associated SQL operator. If not, response time increases, because part of the input data
must be spilled to temporary disk storage. In the extreme case, if the size of a work
area is far too small compared to the input data size, multiple passes over the data
pieces must be performed. This can dramatically increase the response time of the
operator.

SQL工作区
在做排序操作 , 哈希连接 , 位图合并和创建操作时(memory-intensive operator), runtime area is dedicated
to work areas 排序操作和哈希连接处理的数据not fit into工作区时 , 数据被分成更小的块 ,
这样一部分数据在内存中处理 , 另外一部分则spilled to temporary disk storage稍后处理
位图操作不会有上述的spilled to disk操作 , their complexity is inversely proportional to the size of
their work area.
如果工作区远小于需要处理的数据 , 操作的相应时间将会dramatically increase

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-978652/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10599713/viewspace-978652/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值