The query processor is an important layer of architecture, which includes many components. We can split them between query optimization and query execution. Query processor works with the query tree and determines the possible ways of optimization. Many of the complex commands can be optimized with more approaches, and the optimizer can find those, especially for typical DML commands: SELECT, INSERT, UPDATE, DELETE, and MERGE. The query optimizer is based on the following two main inputs:
- Cost: This indicates the cost of the plan
- Cardinality: This indicates the number of rows being processed
The cardinality metric is used as an input to the cost metric, so the better the cardinality, the better the whole cost of the plan. ...