Overview of GPORCA

GPORCA extends the planning and optimization capabilities of the HAWQ legacy optimizer. GPORCA is extensible and achieves better optimization in multi-core architecture environments. When GPORCA is available in your HAWQ installation and enabled, HAWQ uses GPORCA to generate an execution plan for a query when possible.

GPORCA also enhances HAWQ query performance tuning in the following areas:

  • Queries against partitioned tables
  • Queries that contain a common table expression (CTE)
  • Queries that contain subqueries

The legacy and GPORCA query optimizers coexist in HAWQ. The default query optimizer is GPORCA. When GPORCA is available and enabled in your HAWQ installation, HAWQ uses GPORCA to generate an execution plan for a query when possible. If GPORCA cannot be used, the legacy query optimizer is used.

The following flow chart shows how GPORCA fits into the query planning architecture:

You can inspect the log to determine whether GPORCA or the legacy query optimizer produced the plan. The log message, “Optimizer produced plan” indicates that GPORCA generated the plan for your query. If the legacy query optimizer generated the plan, the log message reads “Planner produced plan”. See Determining The Query Optimizer In Use.

Note: All legacy query optimizer (planner) server configuration parameters are ignored by GPORCA. However, if HAWQ falls back to the legacy optimizer, the planner server configuration parameters will impact the query plan generation.