您的位置:首页 > 数据库

SQL 解析过程

2020-04-24 10:28 417 查看


1> Parse phase:
  --Searches for the statement in the shared pool
  -- check syntax
  --check semantics and privileges
  --Merges view definitions and subqueries
  --Determines execution plan
  There are two types of parse operations:
  --Hard Parsing: A SQL statement is submitted for the 1st time, and no shareable match is found .in the shared pool. Hard parses are very expensive.
  --Soft Parsing: A SQL statement is submitted, and a match is found in the shared pool. It is really .good for performance. However, soft parsed still require syntax and security checking.


2> Bind Phase
  During the bind phase:
  --The Oracle DB checks the statement for references of bind variables.
  --The Oracle DB assigns or reassigns a value to each variable.


3> Execute phase:
  --Executes the sql statement
  --Performs necessary I/O and sorts for data(Manipulation language DML statements)


4>Fetch phase:
  --Retrieves rows for a query
  --Sorts for queries when needed
  --Uses an array fetch mechanism

 

  • 点赞
  • 收藏
  • 分享
  • 文章举报
diwujie 发布了2 篇原创文章 · 获赞 0 · 访问量 43 私信 关注
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: