提交 8a18235e 编写于 作者: C Chuck Litzell

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
上级 2155c5a8
......@@ -29,6 +29,8 @@
aggregate plan for a scalar distinct qualified aggregate. </li>
<li><codeph>optimizer_force_three_stage_scalar_dqa</codeph> forces GPORCA to choose a plan
with multistage aggregates when such a plan alternative is generated. </li>
<li><codeph>optimizer_join_order</codeph> sets the query optimization level for join ordering
by specifying which types of join ordering alternatives to evaluate.</li>
<li><codeph>optimizer_join_order_threshold</codeph> specifies the maximum number of join
children for which GPORCA uses the dynamic programming-based join ordering algorithm.</li>
<li><codeph>optimizer_nestloop_factor</codeph> controls nested loop join cost factor to apply
......@@ -52,7 +54,8 @@
<p> For information about the parameters, see the <cite>Greenplum Database Reference
Guide</cite>.</p>
<p>GPORCA generates minidumps to describe the optimization context for a given query. <ph
otherprops="pivotal">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. </ph>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:</p>
......
......@@ -18,6 +18,7 @@
</stentry>
<stentry>
<p><codeph>optimizer_join_arity_for_associativity_commutativity</codeph></p>
<p><codeph>optimizer_join_order</codeph></p>
<p><codeph>optimizer_join_order_threshold</codeph></p>
<p><codeph>optimizer_mdcache_size</codeph>
</p>
......
......@@ -676,6 +676,9 @@
<li><xref href="#optimizer_join_arity_for_associativity_commutativity" type="section"
>optimizer_join_arity_for_associativity_commutativity</xref>
</li>
<li>
<xref href="#optimizer_join_order" type="section">optimizer_join_order</xref>
</li>
<li>
<xref href="#optimizer_join_order_threshold" type="section"
>optimizer_join_order_threshold</xref>
......@@ -7689,13 +7692,15 @@
<p>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.</p>
<p>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.</p>
<p>This parameter has no effect when the <codeph>optimizer_join_order</codeph> parameter is
set to <codeph>query</codeph> or <codeph>greedy</codeph>.</p>
<p>This parameter can be set for a database system or a session.</p>
<table id="table_lfq_3zg_nbb">
<tgroup cols="3">
......@@ -7720,13 +7725,61 @@
</table>
</body>
</topic>
<topic id="optimizer_join_order">
<title>optimizer_join_order</title>
<body>
<p>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.</p>
<ul id="ul_dpf_cyr_1cb">
<li><codeph>query</codeph> - Uses the join order specified in the query.</li>
<li><codeph>greedy</codeph> - Evaluates the join order specified in the query and
alternatives based on minimum cardinalities of the relations in the joins.</li>
<li><codeph>exhaustive</codeph> - Applies transformation rules to find and evaluate
all join ordering alternatives.</li>
</ul>
<p>The default value is <codeph>exhaustive</codeph>. Setting this parameter to
<codeph>query</codeph> or <codeph>greedy</codeph> can generate a suboptimal
query plan. However, if the administrator is confident that a satisfactory plan
is generated with the <codeph>query</codeph> or <codeph>greedy</codeph> setting,
query optimization time can be improved by setting the parameter to the lower
optimization level.</p>
<p>Setting this parameter to <codeph>query</codeph> or <codeph>greedy</codeph>
overrides the <codeph>optimizer_join_order_threshold </codeph> and
<codeph>optimizer_join_arity_for_associativity_commutativity</codeph> parameters. </p>
<p>This parameter can be set for an individual database, a session, or a query. </p>
<table id="table_ucb_str_1cb">
<tgroup cols="3">
<colspec colnum="1" colname="col1" colwidth="1*"/>
<colspec colnum="2" colname="col2" colwidth="1*"/>
<colspec colnum="3" colname="col3" colwidth="1*"/>
<thead>
<row>
<entry colname="col1">Value Range</entry>
<entry colname="col2">Default</entry>
<entry colname="col3">Set Classifications</entry>
</row>
</thead>
<tbody>
<row>
<entry colname="col1">query<p>greedy</p><p>exhaustive</p></entry>
<entry colname="col2">exhaustive</entry>
<entry colname="col3">master<p>session</p><p>reload</p></entry>
</row>
</tbody>
</tgroup>
</table>
</body>
</topic>
<topic id="optimizer_join_order_threshold">
<title>optimizer_join_order_threshold</title>
<body>
<p>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.</p>
<table id="table_z1c_bqp_jx">
<p>This parameter has no effect when the <codeph>optimizer_join_query</codeph> parameter is
set to <codeph>query</codeph> or <codeph>greedy</codeph>.</p>
<table id="table_z1c_bqp_jx">
<tgroup cols="3">
<colspec colnum="1" colname="col1" colwidth="1*"/>
<colspec colnum="2" colname="col2" colwidth="1*"/>
......
......@@ -359,6 +359,8 @@
<stentry>
<p><xref href="guc-list.xml#optimizer_join_arity_for_associativity_commutativity"
type="section">optimizer_join_arity_for_associativity_commutativity</xref></p>
<p><xref href="guc-list.xml#optimizer_join_order" format="dita" type="section"
>optimizer_join_order</xref></p>
<p><xref href="guc-list.xml#optimizer_join_order_threshold" format="dita"
>optimizer_join_order_threshold</xref></p>
<p><xref href="guc-list.xml#optimizer_mdcache_size" type="section"
......
......@@ -221,6 +221,7 @@
<topicref href="guc-list.xml#optimizer_force_multistage_agg"/>
<topicref href="guc-list.xml#optimizer_force_three_stage_scalar_dqa"/>
<topicref href="guc-list.xml#optimizer_join_arity_for_associativity_commutativity"/>
<topicref href="guc-list.xml#optimizer_join_order"/>
<topicref href="guc-list.xml#optimizer_join_order_threshold"/>
<topicref href="guc-list.xml#optimizer_mdcache_size"/>
<topicref href="guc-list.xml#optimizer_metadata_caching"/>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册