oracle - 游标是否在内存中存储 SELECT 结果记录集?

标签 oracle caching plsql database-cursor

我读过的一本书

Whenever you perform a SQL statement, the Oracle opens an area of memory in which the command is parsed and executed. This area is called a cursor.

它适用于显式和隐式游标。但我对另一件事很好奇 - 游标是否可以被视为 Oracle 返回最终记录集并将其用作获取记录的源的中间位置(在内存中)?

最佳答案

游标是指向从查询返回的中间数据集的指针。它包含用于生成和访问结果的状态信息。来自 Concepts Doc :

A cursor is a name or handle to a specific private SQL area. As shown in Figure 14-5, you can think of a cursor as a pointer on the client side and as a state on the server side.

查询的结果是一个结果集,由光标指向。它存储在内存或磁盘中的临时位置。来自 concepts doc :

A temporary tablespace contains schema objects only for the duration of a session. Locally managed temporary tablespaces have temporary files (temp files), which are special files designed to store data in hash, sort, and other operations. Temp files also store result set data when insufficient space exists in memory.

关于oracle - 游标是否在内存中存储 SELECT 结果记录集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12131191/

相关文章:

python - 如何确定lru_cache所需的maxsize?

oracle - 通过定义者角色权限在 PL/SQL 过程中执行动态 DDL

sql - 按特定季度计算减法

oracle - 如何同时使用其他表中的数据更新具有空值的表?

java - Oracle:在java程序中将java日期转换为Oracle日期

c# - .NET Core 2.2 Razor Pages 网站模板以及如何缓存 MSFT Graph 调用

plsql - Oracle 包规范何时变为无效

sql - 没有主键的外键引用

database - 在 pk 和唯一列旁边创建索引的好的候选者是什么?

c# - 到期时自动重新填充缓存