一条SQL语句如何被解析
2007-01-10 20:42
375 查看
Oracle automatically determines whether a SQL statement or PL/SQL block being issued is identical to another statement currently in the shared pool.
Oracle performs the following steps for the comparison:
The text of the statement issued is compared to existing statements in the shared pool.
The text of the statement is hashed. If there is no matching hash value, then the SQL statement does not currently exist in the shared pool, and a hard parse is performed.
If there is a matching hash value for an existing SQL statement in the shared pool, then Oracle compares the text of the matched statement to the text of the statement hashed to see if they are identical. The text of the SQL statements or PL/SQL blocks must be identical, character for character, including spaces, case, and comments.
The objects referenced in the issued statement are compared to the referenced objects of all existing statements in the shared pool to ensure that they are identical.
Bind variables in the SQL statements must match in name, datatype, and length.
The session's environment must be identical. Items compared include the following:
Optimization approach and goal. SQL statements must be optimized using the same optimization approach and, in the case of the cost-based approach, the same optimization goal.
Session-configurable parameters such as
Oracle performs the following steps for the comparison:
The text of the statement issued is compared to existing statements in the shared pool.
The text of the statement is hashed. If there is no matching hash value, then the SQL statement does not currently exist in the shared pool, and a hard parse is performed.
If there is a matching hash value for an existing SQL statement in the shared pool, then Oracle compares the text of the matched statement to the text of the statement hashed to see if they are identical. The text of the SQL statements or PL/SQL blocks must be identical, character for character, including spaces, case, and comments.
The objects referenced in the issued statement are compared to the referenced objects of all existing statements in the shared pool to ensure that they are identical.
Bind variables in the SQL statements must match in name, datatype, and length.
The session's environment must be identical. Items compared include the following:
Optimization approach and goal. SQL statements must be optimized using the same optimization approach and, in the case of the cost-based approach, the same optimization goal.
Session-configurable parameters such as
SORT_AREA_SIZE.
相关文章推荐
- 解析如何用SQL语句在指定字段前面插入新的字段
- mysql如何用一条sql语句实现不存在就插入,存在的话则更新
- 【SQL】如何一次(一条SQL语句)向ORACLE中插入多组/多条数据,不同于mysql
- 如何解析类SQL语句,并提取参数
- SQL 如何实现一条sql语句插入1000行数据
- 如何写随机从表中抽一条数据的SQL语句
- 如何写出一条SQL语句:取出表A中第31~40条记录(SQLServer,以自动增长的ID作为主键
- 常用的文章系统,如何用一条sql语句提取出每个分类的第一条并按OrderCol字段排序。分类大概几十个,一共只要取top 10 这样
- oracle中如何得到一条SQL语句的执行时间
- 转载:如何写个SQL语句查询一个字段里是否有重复记录如果有只读取其中一条记录
- 一条简单SQL语句的构成及语句解析
- mysql中如何用一条sql语句删除多条记录及Shell下执行mysql语句和查询统计
- 如何用一条SQL语句,将多条记录(一个字段)合并为一个?
- 常用的文章系统,如何用一条sql语句提取出每个分类的第一条并按OrderCol字段排序。分类大概几十个,一共只要取top 10 这样
- SQL语句是如何被解析的
- ORACLE中如何用一条SQL语句删除一个表中所有某个列的值为空的数据?
- 如何用一条sql语句删除表中所相同的记录?
- 在oracle中如何用一条sql语句把一个表中多条记录写到另外一个表中
- 如何一条SQL语句 实现 不存在即 INSERT 存在即 UPDATE
- Oracle 中如何用一条SQL语句将“男的改为女的,女的改为男的”?