DEV Community

Maruf13
Maruf13

Posted on

PostgreSQL Query Processing

In PostgreSQL, the parallel query uses multiple background worker processes. A backend process basically handles all queries issued by the connected client. This backend consists of five subsystems, as shown below:

Query image processing

1. Parser:

The parser generates a parse tree from an SQL statement in plain text.

2. Analyzer:

The analyzer/analyser carries out a semantic analysis of a parse tree and generates a query tree.

3. Rewriter:

The rewriter transforms a query tree using the rules stored in the rule system if such rules exist.

4. Planner:

The planner generates the plan tree that can most effectively be executed from the query tree.

5. Executor:

The executor executes the query via accessing the tables and indexes in the order that was created by the plan tree.

✔️ References:

  1. https://age.apache.org/
  2. https://github.com/apache/age
  3. https://www.interdb.jp/pg/index.html

Top comments (0)