You can examine the query plan for the query to determine which query optimizer was used by Greenplum Database to run the query:

    • The optimizer is listed at the end of the query plan. For example, when GPORCA generates the query plan, the query plan ends with:

      When Greenplum Database falls back to the Postgres Planner to generate the plan, the query plan ends with:

      1. Optimizer: Postgres query optimizer
    • These plan items appear only in the EXPLAIN plan output generated by GPORCA. The items are not supported in a Postgres Planner query plan.

      • Assert operator
      • Dynamic Index Scan
      • Dynamic Seq Scan
    • When a query against a partitioned table is generated by GPORCA, the EXPLAIN plan displays only the number of partitions that are being eliminated is listed. The scanned partitions are not shown. The EXPLAIN plan generated by the Postgres Planner lists the scanned partitions.

    Parent topic:

    This example shows the differences for a query that is run against partitioned tables when GPORCA is enabled.

    This query against the table is supported by GPORCA and does not generate errors in the log file:

    1. select * from sales ;

    The EXPLAIN plan output lists only the number of selected partitions.

    If a query against a partitioned table is not supported by GPORCA. Greenplum Database falls back to the Postgres Planner. The plan generated by the Postgres Planner lists the selected partitions. This example shows a part of the explain plan that lists some selected partitions.

    1. -> Seq Scan on sales2_1_prt_7_2_prt_usa sales2 (cost=0.00..0.00 rows=1 width=53)
    2. -> Seq Scan on sales2_1_prt_7_2_prt_asia sales2 (cost=0.00..0.00 rows=1 width=53)
    3. ...

    This example shows the log output when the Greenplum Database falls back to the Postgres Planner from GPORCA.

    A message is added to the log file. The message contains this NOTICE information that indicates the reason GPORCA did not run the query: