Databases Reference
In-Depth Information
Cmd Parser
SQL Server
Network Interface
Optimizer
Query Executor
SNI
Protocol
Layer
Relational Engine
Plan Cache
Transaction Log
Access Methods
Transaction
Mgr
Data Cache
Data file
Bufer
Manager
Storage Engine
Bufer Pool
FIGURE 1-1
The Relational and Storage Engines
As shown in Figure 1-1, SQL Server is divided into two main engines: the Relational Engine and
the Storage Engine. The Relational Engine is also sometimes called the query processor because
its primary function is query optimization and execution. It contains a Command Parser to check
query syntax and prepare query trees; a Query Optimizer that is arguably the crown jewel of any
database system; and a Query Executor responsible for execution.
The Storage Engine is responsible for managing all I/O to the data, and it contains the Access
Methods code, which handles I/O requests for rows, indexes, pages, allocations and row versions;
and a Buffer Manager, which deals with SQL Server's main memory consumer, the buffer pool.
It also contains a Transaction Manager, which handles the locking of data to maintain isolation
(ACID properties) and manages the transaction log.
The Buf er Pool
The other major component you need to know about before getting into the query life cycle is the
buffer pool, which is the largest consumer of memory in SQL Server. The buffer pool contains all
the different caches in SQL Server, including the plan cache and the data cache, which is covered
as the sections follow the query through its life cycle.
NOTE The buffer pool is covered in detail in Chapter 3.
 
Search WWH ::




Custom Search