sort_area_retained_size 摘录一段asktom中tom的解释,对sort内存分配的方式进行了描述:

it will allocate up to sort_area_retained_size in the UGA and the spill over into the "pure" PGA up to sort_area_size if the sort exceeds the sort_area_retained_size AND sort_area_size is greater then sort_area_retained_size.
 
the sort_area_retained_size parameter is often misunderstood. At a high level, this is what happens:
 
to do a sort, Oracle allocates chunks of memory up to a maximum of sort_area_size.
 
As each chunk is allocated -- Oracle checks to see if the sort area is less then the sort_area_retained_size.
 
If so, this chunk is allocated in memory that survives from call to call (in the UGA -- where ever the UGA might be -- in the pga or sga). This memory survives as long as needed (across many calls potentially to fetch rows and such)
 
If not, this chunk is allocated in the "pure pga" and freed at the end of the call. This memory does not survive across calls at all.
 
Sort area memory is not necessarily contigous memory -- hence bits of it could be in the SGA, some in the PGA -- it matters not to Oracle.
 
see also
1) What happens when the sort is completed,I mean where is the resultset(fetched rows) kept before sending it to the user process.According to me ,it is in UGA.

1) the sort workarea is kept in whole or part (the rest goes to TEMP on disk). The rows come from this 'retained' size.

In manual memory management, you used to set

a) sort_area_size
b) sort_area_RETAINED_size

the amount of memory upto (a) would be allocated during the sort and upon completion - right before returning the data, the workarea would be shrunk down to (b) with any excess being written to disk. So, you could set (a) to 10mb and (b) to 1mb - we'd use 10mb to sort the data, shrink the workarea does to 1mb and use that as a buffer to return the data to the client through.

In automatic memory management, the server sets (a) and (b) as it likes.

sort_area_retained_size之tom解释的更多相关文章

  1. Spark算子 - groupBy

    释义 根据RDD中的某个属性进行分组,分组后形式为(k, [(k, v1), (k, v2), ...]),即groupBy 后组内元素会保留key值 方法签名如下: def groupBy[K](f ...

  2. LINQ之路 8: 解释查询(Interpreted Queries)

    LINQ提供了两个平行的架构:针对本地对象集合的本地查询(local queries),以及针对远程数据源的解释查询(Interpreted queries). 在讨论LINQ to SQL等具体技术 ...

  3. springmvc 注解 配置文件解释

    概述 继 Spring 2.0 对 Spring MVC 进行重大升级后,Spring 2.5 又为 Spring MVC 引入了注解驱动功能.现在你无须让 Controller 继承任何接口,无需在 ...

  4. count(*)、count(val)和count(1)的解释

    一.关于count的一些谣言: 1.count(*)比count(val)更慢!项目组必须用count(val),不准用count(*),谁用扣谁钱! 2.count(*)用不到索引,count(va ...

  5. php 23种设计模式的趣味解释

    http://wenku.baidu.com/link?url=GwvuvSOdJneZQc-DSKoGmPcxTtzn3cdtIp3fRaCNbkg1zJDZZZTx2NwEK5IsqU996fG3 ...

  6. 转--23种设计模式的搞笑解释(后续放逐一C++解释版本)

    创建型模式 1.FACTORY —追MM少不了请吃饭了,麦当劳的鸡翅和肯德基的鸡翅都是MM爱吃的东西,虽然口味有所不同,但不管你带MM去麦当劳或肯德基,只管向服务员说“来四个鸡翅”就行了.麦当劳和肯德 ...

  7. X窗口系统名词解释

    前端时间Gentoo的桌面环境出了点问题,发现自己对Linux的桌面环境了解的很少,于是恶补了一下知识,以下名词解释基本上都是来自维基百科的条目和<Linux程序设计(第三版)>.一般而言 ...

  8. javascript - 浏览TOM大叔博客的学习笔记

    part1 ---------------------------------------------------------------------------------------------- ...

  9. 【设计模式】用追MM来解释23种设计模式,转

    创建型模式 1.FACTORY—追MM少不了请吃饭了,麦当劳的鸡翅和肯德基的鸡翅都是MM爱吃的东西,虽然口味有所不同,但不管你带MM去麦当劳或肯德基,只管向服务员说“来四个鸡翅”就行了.麦当劳和肯德基 ...

随机推荐

  1. iView开始结束时间组件

    演示地址:https://run.iviewui.com/TGIKGkIt 测试页面文件: <template> <div> <startEndTime @newEndT ...

  2. Fragment 底部菜单栏

    实例讲解一 实例效果图: 点击wifi“按钮”显示的界面: 项目结构 具体代码编写 1.左边页面布局界面,frag_list.xml: <?xml version="1.0" ...

  3. Android 编辑框插入表情图片

    首先,把整理好的表情图片以及布局用到的一些图片导入到项目的res/drawable目录中. 然后,编辑res/layout目录下布局.xml文件,这里我把oschina客户端的布局代码贴上来,供大家参 ...

  4. Activity 四种launchMode

    launchMode在多个Activity跳转的过程中扮演着重要的角色,它可以决定是否生成新的Activity实例,是否重用已存在的 Activity实例,是否和其他Activity实例公用一个tas ...

  5. Java快速入门-05-数组循环条件 实例《延禧攻略》

    <延禧攻略>如此火爆,蹭蹭热度,用 JAVA 最基础的数组,循环,条件,输入/输出,做了一个简单的小游戏,帮助初学者巩固 JAVA 基础,注释非常详细 动态图展示: xuanfei.jav ...

  6. JS的Event Loop

    JavaScript是单线程的,只有一个执行栈,一次只能做一件事. 在浏览器中,却“好像”可以同时做几件事:点击,发送请求,执行多个函数,解析代码. 这是因为浏览器实现的Event Loop机制. W ...

  7. Week2——提交表单后后台的工作

    在我理解看来,发生请求后主要是通过域进行相互间的协调作用的.表单数据可以从request域中获得,也可以通过response域返回数据给前台. 当发起http请求后,已经启动的Tomcat服务器解析收 ...

  8. laravel middleware

    当你使用larvel创建一个相对比较复杂的web网站时,往往你的routes文件就会变得很庞大.一般来说在开始网站编码之前,最好做一个整体规划,把这些route逻辑上划分为不同的group,每一个gr ...

  9. java笔记--String类对象解析与运用

    --如果朋友您想转载本文章请注明转载地址"http://www.cnblogs.com/XHJT/p/3877236.html "谢谢-- 1.String中的equals和==的 ...

  10. iOS设计模式 - 原型

    iOS设计模式 - 原型 原理图 说明 1. 原型模式指的是从一个已有的对象复制并创建出新的对象 2. 当一个类的实例之间存在差异,而这些差异仅是状态的若干组合,复制原型要比手工实例化更加方便 3. ...