SQL Engine - SQL processing (Sql Compiler)

Oracle Database Sql Processing

About

In which way the database processes:

  • DDL statements to create objects,
  • DML to modify data, and
  • queries to retrieve data.

Stages of SQL Processing

Oracle Database Sql Processing

Depending on the statement, the database may omit some of these steps.

Parsing

SQL Engine - SQL Parser

Optimization

SQL Engine - Query Optimizer (Query Optimization)

Query optimization is the process of choosing the most efficient means of executing a SQL statement. The database optimizes queries based on the optimizer statistics collected about the actual data being accessed.

The optimizer uses statistics such as :

  • the number of rows,
  • the size of the data set,
  • and other factors

to generate possible execution plans,

  • assigning a numeric cost to each plan.

The database uses the plan with the lowest cost.

Row Source Generation

SQL Engine - Row source generator

Execution

SQL Engine - Execution

Documentation / Reference





Discover More
Card Puncher Data Processing
Calcite - Query Planning Process (Sql Processing)

in Calcite The query planning process is the entire process that takes a SQL to a result. The process can be resumed as follow: Phase 1: The Sql statement (Query) is parsed to build a parse tree...
Data System Architecture
Concurrency - Latches (System Lock)

Latches are like semaphores. Latches are used to guarantee physical consistency of data, while locks are used to assure logical consistency of data. Latches are simple, low-level system lock (serialization...
Card Puncher Data Processing
Oracle Database - DDL Locks (data dictionary lock)

A data dictionary (DDL) lock protects the definition of a schema object while an ongoing DDL operation (CREATE, ALTER, DROP) acts on or refers to the object. Only individual schema objects that are modified...
Oracle Database Sql Processing
RDBMS - Sql Processing (Engine)

A SQL engine is responsible to produce a result set on the client side (generally backed by a cursor on the back-end side) from a SQL statement. See Every relational database has an SQL engine:...
Oracle Database Sql Processing
SQL Engine - SQL Parser

The parser in an SQL engine parse a Sql statement. It's the first stage of SQL processing. This stage involves separating the pieces of a SQL statement into a SQL Tree where each node is a SQL token...
Oracle Database Sql Processing
SQL Engine - Execution

Execution is the last step of sql processing. The SQL engine executes each row source in the tree produced by: the row source generator (within an hard parse) or a soft parse. This step is the...
Oracle Database Sql Processing
SQL Engine - Hard Parse (Library cache miss)

During the sql parsing (which is a step of the sql processing), if the Database (for instance Oracle) cannot reuse existing code, then it must build a new executable version of the application code (ie...
Query Optimizer Process
SQL Engine - Query Optimizer (Query Optimization)

in a SQL Engine. A SQL statement can be executed in many different ways, such as: full table scans, index scans, nested loops, hash joins. The query optimizer determines the most efficient...
Oracle Database Sql Processing
SQL Engine - Row source generator

The row source generator performs the row source generation steps of an SQL processing. It receives the optimal execution plan from the optimizer and produces an iterative plan, called the query plan,...
Oracle Database Sql Processing
SQL Engine - Soft parse (Library cache hit)

A soft parse is any SQL parse that is not a hard parse. If the submitted statement is the same as a reusable SQL statement in the shared pool, then Oracle Database reuses the existing code. This reuse...



Share this page:
Follow us:
Task Runner