Query management in the query manager is an indicator for determining whether a database is powerful or not. Through query management, you can convert a bad query statement into a piece of code that can be executed quickly. after the code is executed, the result is returned to the client manager. The entire process is divided into multiple steps: the query is first parsed and its validity is checked; the query is rewritten and unnecessary operations are deleted.
Query management in the query manager is an indicator for determining whether a database is powerful or not. Through query management, you can convert a bad query statement into a piece of code that can be executed quickly. after the code is executed, the result is returned to the client manager. The entire process is divided into multiple steps: the query is first parsed and its validity is checked; the query is rewritten and unnecessary operations are deleted.
Query Manager
Query management is an indicator for determining whether a database is powerful or not. Through query management, you can convert a bad query statement into a piece of code that can be executed quickly. after the code is executed, the result is returned to the client manager. The entire process is divided into multiple steps:
- The query is first parsed and its validity is checked;
- Rewrite the query and delete unnecessary operations, and make some pre-optimization;
- To improve performance, make necessary optimizations and finally convert them into an execution plan;
- Compile the execution plan;
- Finally, run the execution plan.
After reading this chapter, if you want to have a better understanding of query optimization, I recommend that you read the following materials:
- The first paper on cost optimization published in 1979: Access Path Selection in a Relational Database Management System. This paper has only 12 pages and can be understood as long as it has an intermediate level in computer science.
- In-depth introduction to how to optimize queries in DB 9.x: DB2 for Linux, UNIX, and Windows Optimizer.
- A detailed introduction to how PostgreSQL optimizes queries: Explaining the Query Optimizer. This article is very easy to understand, because it does not introduce PostgreSQL algorithms, but shows PostgreSQL's query plan.
- SQLite official optimization Documentation: The SQLite Query Planner. It is easy to understand, and you are very simple to optimize the rules for SQLite; but it only explains how the optimizer works.
- SQL Server 2005 optimization Query introduction: Understanding Query Processing and Query Plans in SQL Server
- Orcale 12c optimization White Paper: Optimizer with Oracle Database 12c
- The author of database system concepts has two theoretical courses on Query Optimization. they mainly focus on disk IO: Chapter 12: Query Processing and Chapter 13: Query Optimization.
- There is also a theoretical course I found that is easier to understand and only describes join operations and disk IO: Datenbanksysteme II: Implementation of Database Systems