Skip to the content.

Architecture of a Database System


Section 4 - Relational Query Processor

Can be viewed as a single-user single-threaded task, concurrency is mananged by lower layers of the system. (Exception - buffer pool pages)

4.1 Query parsing and authorization

4.2 Query Rewrite

4.3 Query Optimizer

Query optimizer’s job is to transform an internal query representation into an efficient query plan which is basically data flowing through a graph of query operators. Query plans are generally compiled into some interpretable data structure (lightweight object or bytecode for example) which enables cross-platform compatibility.

Optimizer’s functionality can be extended to:

  1. Select query plan space e.g. left deep plans only
  2. Estimate selectivity
  3. Decide on algorithms for searching the plan space
  4. Generate parallelizable plans
  5. Auto tuning based on query workload (e.g. choosing which views to materialize)

4.3.1 Prepare and execute model

4.4 Query Executor

4.4.1 Iterators

4.4.2 Where is the data stored?

4.4.3 Handling DML queries

4.5 Access methods

4.6 Data Warehouses