Skip to content

The query plan

Andrey Lepikhov edited this page Feb 21, 2020 · 1 revision

Why are we not get the optimal query plan?

  1. Planner get incorrect cost estimations for plan nodes.
  2. GEQO algorithm can't achieve global optimum.

If we use AQO we have correct estimations for each node of executed plan. But not all of paths are executed because of poor estimations (may be correct or not). If AQO will give positive predictions for the not known nodes, we will got optimal query plan in the case of base_search algorithm. With GEQO algorithm we have not any guarantees, but we can touch geqo_seed, geqo_effort GUC's. In this case we have more chances to find out an optimal plan.