select语句的结果集可能会存放在pga的UGA区域以及对DML语句中的d
select语句的结果集可能会存放在pga的UGA区域 问: oracle执行select操作,返回的结果集存放在什么位置?结果集中保存的是rowid集合还是真实的数据?返回的结果集是放在PGA区域么?如果返回的是真实的数据,那么如果数据量过大会不会造成内存溢出?请各位高
select语句的结果集可能会存放在pga的UGA区域
问:oracle执行select操作,返回的结果集存放在什么位置?结果集中保存的是rowid集合还是真实的数据?返回的结果集是放在PGA区域么?如果返回的是真实的数据,那么如果数据量过大会不会造成内存溢出?请各位高手解答
答:
If it's a simple select * from table, the data goes straight to the client. If the SQL has some intermediate steps for data processing,such as select count(*) from table,
UGA will be used. In dedicated config, UGA is part of PGA.
Of course the data blocks will be scanned into SGA (buffer cache specifically), unless it's a direct path read. Your original question is whether the data will be in PGA. I already answered that. But no matter whether it's select *... or select count(*)
..., the table data must go to the buffer cache first (except for parallel read, and a few other special cases of direct path read).
Yong Huang
即对于直接获取的数据,没有必要额外存放,数据已经在那里(buffer cache, logical read/disk,phisical read logical read)
对于中间结果,例如Huang版说的,或者,排序结果、数组之类的,应该在PGA或磁盘中
参考:
http://www.itpub.net/thread-1505871-1-1.html
谷歌 select语句结果集 pga
==================================================================================================================================
对DML语句中的db block gets direct理解
问:
从v$sysstat中可以看到db block gets由db block gets from cache和db block gets direct构成.
前者很好理解,后者的含义是:"Number of times a CURRENT block was requested bypassing the buffer cache"
那么为什么要bypassing the buffer cache呢?
是因为在buffer cache中找不到吗?如果是因为在buffer cache中找不到,所以才bypassing buffer cache而到磁盘上找,那么db block gets direct的数量 + consistent gets direct的数量,就应该等于physical reads的数量,但实际确非如此,为什么呢?谢谢
答:
buffer cache的目的是什么呢?
如果你需要读取的block不适合,设buffer cache的目的甚至违背了其初衷。
那是不是应该bypassing buffer cache呢?
也就是说,一般情况下,要读一个block,都是“应该先到buffer cache中去找,找不到再从磁盘上找到,并先放到buffer cache中,以备下次需要时能直接从buffer cache中找到”的。
但是,有时候数据会被读到PGA中的,即如果大量数据要被读入,而且不会复用,那么读到buffer cache中就不合适了。
问:
这个bypassing buffer cache,是说的直接bypassing buffer cache,直接到磁盘上找; 还是说先到buffer cache中找不到而被迫到磁盘上找,然后找出来的block不放到buffer cache中去呢?
答:bypassing buffer cache直接到磁盘上找。
疑问:
关于db block gets direct
db block gets (from cache)是buffer cache中的current mode gets,
那么db block gets direct应该是pga中的current mode gets吧?
(执行DML语句时发生db block gets direct,则数据文件上的数据块直接存放到pga上的,所以应该是如此吧)
没有找到正式的说法
参考:
http://www.itpub.net/forum.php?mod=viewthread&tid=963118&highlight=
百度 db block gets direct
http://blog.itpub.net/7608831/viewspace-693190/ =
http://oracle.zwcoom.com/Oracle/Oracleguanli/20100312/143435.html
附加
1.3 CGA(调用全局区)的相关概念
CGA也是一块内存区域,但它是动态的,即随着调用(call)的开始而创建,在调用过程中一直存在,直到调用结束时被释放。它存放的是在调用过程中所需要的数据。
我们知道,调用主要包括解析(parse)调用、执行(executive)调用、获取(fetch)调用以及递归SQL调用和PL/SQL调用。从调用的种类可以看出,实际上在调用过程中所需要的数据,比如SQL AREA,PL/SQL AREA和SORT AREA基本都是放在UGA中的,因为这些数据在各个调用之间必须一直存在并可用。而在CGA中只存放了在调用过程中临时需要的数据,比如直接I/O缓存(Direct I/O Buffer)以及堆栈空间等数据结构。因此,没有CGA中的数据结构,调用是无法完成的。
注意,CGA不象UGA可以位于SGA中(以共享服务器模式连接),CGA一定是位于PGA中的。如果当前进程正在运行,则每个PGA中只有一个CGA。如果当前进程没有运行,则该进程的PGA中就没有CGA。
上述说明,sql语句并行化查询时,产生的direct path read,是将数据文件上的数据读取到的pga上的cga这个区域的。
SQL操作指的不是一条SQL语句,而是其中的一个操作。如,需要sql工作区的SQL操作为哈希连接、排序等。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



How to hide the select element in jquery: 1. hide() method, introduce the jQuery library into the HTML page, you can use different selectors to hide the select element, the ID selector replaces the selectId with the ID of the select element you actually use; 2. css() method, use the ID selector to select the select element that needs to be hidden, use the css() method to set the display attribute to none, and replace selectId with the ID of the select element.

Asynchronous processing method of SelectChannelsGo concurrent programming using golang Introduction: Concurrent programming is an important area in modern software development, which can effectively improve the performance and responsiveness of applications. In the Go language, concurrent programming can be implemented simply and efficiently using Channels and Select statements. This article will introduce how to use golang for asynchronous processing methods of SelectChannelsGo concurrent programming, and provide specific

jQuery is a popular JavaScript library that can be used to simplify DOM manipulation, event handling, animation effects, etc. In web development, we often encounter situations where we need to change event binding on select elements. This article will introduce how to use jQuery to bind select element change events, and provide specific code examples. First, we need to create a dropdown menu with options using labels:

Because select allows developers to wait for multiple file buffers at the same time, it can reduce IO waiting time and improve the IO efficiency of the process. The select() function is an IO multiplexing function that allows the program to monitor multiple file descriptors and wait for one or more of the monitored file descriptors to become "ready"; the so-called "ready" state is Refers to: the file descriptor is no longer blocked and can be used for certain types of IO operations, including readable, writable, and exceptions. select is a computer function located in the header file #include. This function is used to monitor file descriptor changes—reading, writing, or exceptions. 1. Introduction to the select function. The select function is an IO multiplexing function.

1. Keywords in SQL statements are not case-sensitive. SELECT is equivalent to SELECT, and FROM is equivalent to from. 2. To select all columns from the users table, you can use the symbol * to replace the column name. Syntax--this is a comment--query out [all] data from the [table] specified by FEOM. * means [all columns] SELECT*FROM--query out the specified data from the specified [table] from FROM Data of column name (field) SELECT column name FROM table name instance--Note: Use English commas to separate multiple columns selectusername, passwordfrom

Implementing SelectChannels through golang Performance optimization of Go concurrent programming In the Go language, it is very common to use goroutine and channel to implement concurrent programming. When dealing with multiple channels, we usually use select statements for multiplexing. However, in the case of large-scale concurrency, using select statements may cause performance degradation. In this article, we will introduce some implementations of select through golang

With the development of web applications, PHP language has been widely used in web development. In the PHP8.0 version, a new language feature was introduced - the multi-catch statement. What is a multi-catch statement? In previous PHP versions, developers needed to write multiple catch statements to handle multiple exception types. For example, the following code block shows the handling of two different exceptions: try{//Somecodethatmay

SelectChannels for Reliability and Robustness Using Golang Introduction to Concurrent Programming: In modern software development, concurrency has become a very important topic. Using concurrent programming can make programs more responsive, utilize computing resources more efficiently, and be better able to handle large-scale parallel computing tasks. Golang is a very powerful concurrent programming language. It provides a simple and effective way to implement concurrent programming through go coroutines and channel mechanisms.
