Difference between revisions of "SQL Process Flow"

From Robs_Wiki
Jump to: navigation, search
(Step 1 Statement is parsed)
(Step 1 Statement is parsed)
Line 4: Line 4:
 
The user issues a statement and the statement is parsed by the database. When an application issues a SQL statement, the application makes a parse call to the database to prepare the statement for execution. The parse call opens or creates a cursor, which is a handle for the session-specific private SQL area that holds a parsed SQL statement and other processing information. The cursor and private SQL area are in the program global area (PGA).<br />
 
The user issues a statement and the statement is parsed by the database. When an application issues a SQL statement, the application makes a parse call to the database to prepare the statement for execution. The parse call opens or creates a cursor, which is a handle for the session-specific private SQL area that holds a parsed SQL statement and other processing information. The cursor and private SQL area are in the program global area (PGA).<br />
 
The parse call involves 3 steps:
 
The parse call involves 3 steps:
* syntax check (no errors in SQL statement)
+
* '''syntax check''' (no errors in SQL statement)
* semantics check (do the objects actually exist)
+
* '''semantics check''' (do the objects actually exist)
* shared pool check (to determine if the statement is already in the shared pool so it can skip resource-intensive steps of statement processing.) SQL statements are hashed and this hash (SQL_ID) is checked.
+
* '''shared pool check''' (to determine if the statement is already in the shared pool so it can skip resource-intensive steps of statement processing.) SQL statements are hashed and this hash (SQL_ID) is checked.

Revision as of 23:03, 21 February 2020

Step 1 Statement is parsed

The user issues a statement and the statement is parsed by the database. When an application issues a SQL statement, the application makes a parse call to the database to prepare the statement for execution. The parse call opens or creates a cursor, which is a handle for the session-specific private SQL area that holds a parsed SQL statement and other processing information. The cursor and private SQL area are in the program global area (PGA).
The parse call involves 3 steps:

  • syntax check (no errors in SQL statement)
  • semantics check (do the objects actually exist)
  • shared pool check (to determine if the statement is already in the shared pool so it can skip resource-intensive steps of statement processing.) SQL statements are hashed and this hash (SQL_ID) is checked.