From 8a18235ed0376c620ce6886598be9e9b72b4bb83 Mon Sep 17 00:00:00 2001 From: Chuck Litzell Date: Tue, 5 Dec 2017 13:39:46 -0600 Subject: [PATCH] docs: optimizer_join_order guc (#4014) * docs: optimizer_join_order guc * Implement suggested edits * Note iteractions with other params; correct inaccurate statement. * Clarify this is a GPORCA guc --- .../query/topics/query-piv-opt-notes.xml | 5 +- .../admin_guide/topics/gporca-parameters.xml | 1 + .../dita/ref_guide/config_params/guc-list.xml | 57 ++++++++++++++++++- .../config_params/guc_category-list.xml | 2 + .../config_params/guc_config.ditamap | 1 + 5 files changed, 63 insertions(+), 3 deletions(-) diff --git a/gpdb-doc/dita/admin_guide/query/topics/query-piv-opt-notes.xml b/gpdb-doc/dita/admin_guide/query/topics/query-piv-opt-notes.xml index b4da10ea54..ddfc44346c 100644 --- a/gpdb-doc/dita/admin_guide/query/topics/query-piv-opt-notes.xml +++ b/gpdb-doc/dita/admin_guide/query/topics/query-piv-opt-notes.xml @@ -29,6 +29,8 @@ aggregate plan for a scalar distinct qualified aggregate.
  • optimizer_force_three_stage_scalar_dqa forces GPORCA to choose a plan with multistage aggregates when such a plan alternative is generated.
  • +
  • optimizer_join_order sets the query optimization level for join ordering + by specifying which types of join ordering alternatives to evaluate.
  • optimizer_join_order_threshold specifies the maximum number of join children for which GPORCA uses the dynamic programming-based join ordering algorithm.
  • optimizer_nestloop_factor controls nested loop join cost factor to apply @@ -52,7 +54,8 @@

    For information about the parameters, see the Greenplum Database Reference Guide.

    GPORCA generates minidumps to describe the optimization context for a given query. The minidump files are used by Pivotal support to analyze Greenplum + otherprops="pivotal" + >The minidump files are used by Pivotal support to analyze Greenplum Database issues. The information in the file is not in a format that can be easily used for debugging or troubleshooting. The minidump file is located under the master data directory and uses the following naming format:

    diff --git a/gpdb-doc/dita/admin_guide/topics/gporca-parameters.xml b/gpdb-doc/dita/admin_guide/topics/gporca-parameters.xml index ccbeafd5d2..60211b5a6c 100644 --- a/gpdb-doc/dita/admin_guide/topics/gporca-parameters.xml +++ b/gpdb-doc/dita/admin_guide/topics/gporca-parameters.xml @@ -18,6 +18,7 @@

    optimizer_join_arity_for_associativity_commutativity

    +

    optimizer_join_order

    optimizer_join_order_threshold

    optimizer_mdcache_size

    diff --git a/gpdb-doc/dita/ref_guide/config_params/guc-list.xml b/gpdb-doc/dita/ref_guide/config_params/guc-list.xml index 94af1b357e..5f1b3c2f9f 100644 --- a/gpdb-doc/dita/ref_guide/config_params/guc-list.xml +++ b/gpdb-doc/dita/ref_guide/config_params/guc-list.xml @@ -676,6 +676,9 @@
  • optimizer_join_arity_for_associativity_commutativity
  • +
  • + optimizer_join_order +
  • optimizer_join_order_threshold @@ -7689,13 +7692,15 @@

    The value is an optimization hint to limit the number of join associativity and join commutativity transformations explored during query optimization. The limit controls the alternative plans that GPORCA considers during query optimization. For example, the default - value of 7 is a optimization hint for GPORCA to stop exploring join associativity and join + value of 7 is an optimization hint for GPORCA to stop exploring join associativity and join commutativity transformations when an n-ary join operator has more than 7 children during optimization.

    For a query with a large number of joins, specifying a lower value improves query performance by limiting the number of alternate query plans that GPORCA evaluates. However, setting the value too low might cause GPORCA to generate a query plan that performs sub-optimally.

    +

    This parameter has no effect when the optimizer_join_order parameter is + set to query or greedy.

    This parameter can be set for a database system or a session.

    @@ -7720,13 +7725,61 @@
    + + optimizer_join_order + +

    When GPORCA is enabled, this parameter sets the optimization level for join + ordering during query optimization by specifying which types of join ordering + alternatives to evaluate.

    +
      +
    • query - Uses the join order specified in the query.
    • +
    • greedy - Evaluates the join order specified in the query and + alternatives based on minimum cardinalities of the relations in the joins.
    • +
    • exhaustive - Applies transformation rules to find and evaluate + all join ordering alternatives.
    • +
    +

    The default value is exhaustive. Setting this parameter to + query or greedy can generate a suboptimal + query plan. However, if the administrator is confident that a satisfactory plan + is generated with the query or greedy setting, + query optimization time can be improved by setting the parameter to the lower + optimization level.

    +

    Setting this parameter to query or greedy + overrides the optimizer_join_order_threshold and + optimizer_join_arity_for_associativity_commutativity parameters.

    +

    This parameter can be set for an individual database, a session, or a query.

    + + + + + + + + Value Range + Default + Set Classifications + + + + + query

    greedy

    exhaustive

    + exhaustive + master

    session

    reload

    +
    + + +
    + +
    optimizer_join_order_threshold

    When GPORCA is enabled (the default), this parameter sets the maximum number of join children for which GPORCA will use the dynamic programming-based join ordering algorithm. You can set this value for a single query or for an entire session.

    - +

    This parameter has no effect when the optimizer_join_query parameter is + set to query or greedy.

    +
    diff --git a/gpdb-doc/dita/ref_guide/config_params/guc_category-list.xml b/gpdb-doc/dita/ref_guide/config_params/guc_category-list.xml index 98b74dca48..aa878a3c98 100644 --- a/gpdb-doc/dita/ref_guide/config_params/guc_category-list.xml +++ b/gpdb-doc/dita/ref_guide/config_params/guc_category-list.xml @@ -359,6 +359,8 @@

    optimizer_join_arity_for_associativity_commutativity

    +

    optimizer_join_order

    optimizer_join_order_threshold

    + -- GitLab