提交 b4e2e3e2 编写于 作者: D Daniel Gustafsson

Rename legacy planner to Postgres planner

As we merge with upstream and by that keep refining the Postgres
planner, legacy planner is no longer a suitable name. This changes
all variations of the spelling (legacy planner, legacy optimizer,
legacy query optimizer etc) to say "Postgres" rather than "legacy".
Reviewed-by: NVenkatesh Raghavan <vraghavan@pivotal.io>
Reviewed-by: NDavid Yozie <dyozie@pivotal.io>
Reviewed-by: NGeorgios Kokolatos <gkokolatos@pivotal.io>
上级 1053af8a
......@@ -100,7 +100,7 @@ Once build and started, run `psql` and check the GPOPT (e.g. GPORCA) version:
select gp_opt_version();
```
To turn GPORCA off and use legacy planner for query optimization:
To turn GPORCA off and use Postgres planner for query optimization:
```
set optimizer=off;
```
......
......@@ -172,7 +172,7 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM agg_csv;
Foreign Scan on public.agg_csv
Output: a, b
Foreign File: @abs_srcdir@/data/agg.csv
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
\t off
PREPARE st(int) AS SELECT * FROM agg_csv WHERE a = $1;
......@@ -245,7 +245,7 @@ EXPLAIN (VERBOSE, COSTS FALSE) SELECT * FROM agg_text WHERE a > 0;
Output: a, b
Filter: (agg_text.a > 0)
Foreign File: @abs_srcdir@/data/agg.data
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
\t off
-- privilege tests for object
......
......@@ -243,7 +243,7 @@ PARTITION BY LIST (gender)
  DEFAULT PARTITION other );
</codeblock>
</p>
<note>The current Greenplum Database legacy optimizer allows list partitions with
<note>The current Greenplum Database Postgres optimizer allows list partitions with
multi-column (composite) partition keys. A range partition only allows a single column as
the partition key. The Greenplum Query Optimizer does not support composite keys, so you
should not use composite partition keys.</note>
......@@ -343,7 +343,7 @@ GRANT SELECT ON sales TO guest;
<p>GPORCA, the Greenplum next generation query optimizer, supports uniform multi-level
partitioned tables. If GPORCA is enabled (the default) and the multi-level partitioned
table is not uniform, Greenplum Database executes queries against the table with the
legacy query optimizer. For information about uniform multi-level partitioned tables, see
Postgres query optimizer. For information about uniform multi-level partitioned tables, see
<xref href="../query/topics/query-piv-uniform-part-tbl.xml#topic1"/>.</p>
<p>For information about exchanging a leaf child partition with an external table, see <xref
href="#topic_yhz_gpn_qs" format="dita"/>.</p>
......@@ -351,7 +351,7 @@ GRANT SELECT ON sales TO guest;
an external table:</p>
<ul id="ul_byq_wdd_bt">
<li>Queries that run against partitioned tables that contain external table partitions are
executed with the legacy query optimizer.</li>
executed with the Postgres query optimizer.</li>
<li>The external table partition is a read only external table. Commands that attempt to
access or modify data in the external table partition return an error. For example:<ul
id="ul_ugr_try_bt">
......
......@@ -274,7 +274,7 @@ CREATE OPERATOR CLASS abs_int_hash_ops FOR TYPE int4
OPERATOR 1 |=|,
FUNCTION 1 abshashfunc(int);</codeblock></p>
<p>Also, create less than and greater than operators, and a btree operator class for
them. We don't need them for our queries, but the Greenplum Database legacy query
them. We don't need them for our queries, but the Greenplum Database Postgres query
planner will not consider co-location of joins without
them.<codeblock>CREATE FUNCTION abslt(int, int) RETURNS BOOL AS
$$
......@@ -330,7 +330,7 @@ INSERT INTO btab VALUES (-1), (0), (1), (2);</codeblock></p>
-&gt; Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: atab.a
-&gt; Seq Scan on atab
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
</codeblock></p>
</section>
......
......@@ -363,7 +363,7 @@
an update operation and a later transaction executes an update or delete and the query
plan contains a motion operator.</li>
<li>Concurrent update transactions on the same distribution key of a heap table that are
executed by the Greenplum Database legacy query optimizer.</li>
executed by the Greenplum Database Postgres query optimizer.</li>
<li>Concurrent update transactions on the same row of a hash table that are executed by
the GPORCA optimizer.</li>
</ul></p>
......
......@@ -378,7 +378,7 @@
tables are always analyzed. </p><p>If GPORCA is enabled (the default), you also need to
run <codeph>ANALYZE</codeph> or <codeph>ANALYZE ROOTPARTITION</codeph> to refresh the root
partition statistics. GPORCA requires statistics at the root level for partitioned tables.
The legacy optimizer does not use these statistics. </p><p>The time to analyze a
The Postgres optimizer does not use these statistics. </p><p>The time to analyze a
partitioned table is similar to the time to analyze a non-partitioned table with the same
data since <codeph>ANALYZE ROOTPARTITION</codeph> does not collect statistics on the leaf
partitions (the data is only sampled). The <codeph>analyzedb</codeph> utility updates root
......@@ -415,7 +415,7 @@
individual column. By default, the target is 25. The default target can be changed by
setting a server configuration parameter and the target can be set for any column using
the <codeph>ALTER TABLE</codeph> command. Larger values increase the time needed to do
<codeph>ANALYZE</codeph>, but may improve the quality of the legacy query optimizer
<codeph>ANALYZE</codeph>, but may improve the quality of the Postgres query optimizer
(planner) estimates.</p>
<p>Set the system default statistics target to a different value by setting the
<codeph>default_statistics_target</codeph> server configuration parameter. The default
......
......@@ -24,7 +24,7 @@
row-oriented or column-oriented append-optimized tables can be compressed. </p>
<p>The main differences between Greenplum Database and PostgreSQL are as follows:<ul
id="ul_tnk_ymb_c1b">
<li>GPORCA is leveraged for query planning, in addition to the legacy query planner, which
<li>GPORCA is leveraged for query planning, in addition to the Postgres query planner, which
is based on the Postgres query planner.</li>
<li>Greenplum Database can use append-optimized storage.</li>
<li>Greenplum Database has the option to use column storage, data that is logically
......
......@@ -24,7 +24,7 @@
stages of processing a query.</p></li>
</ul>
<note>Greenplum Database uses GPORCA, the Greenplum next generation query optimizer, by default.
GPORCA extends the planning and optimization capabilities of the Greenplum Database legacy
GPORCA extends the planning and optimization capabilities of the Postgres
optimizer. For information about the features and limitations of GPORCA, see <xref
href="query-piv-opt-overview.xml"/>.</note>
</body>
......
......@@ -5,7 +5,7 @@
<title>Changed Behavior with the GPORCA</title>
<abstract>
<shortdesc>There are changes to Greenplum Database behavior with the GPORCA optimizer enabled
(the default) as compared to the legacy planner.</shortdesc>
(the default) as compared to the Postgres planner.</shortdesc>
</abstract>
<body>
<ul id="ul_v1c_kll_gr">
......@@ -13,7 +13,7 @@
<li><cmdname>UPDATE</cmdname> operations on partitioned keys are allowed.</li>
<li>Queries against uniform partitioned tables are supported.</li>
<li>Queries against partitioned tables that are altered to use an external table as a leaf
child partition fall back to the legacy query optimizer.</li>
child partition fall back to the Postgres query optimizer.</li>
<li>Except for <codeph>INSERT</codeph>, DML operations directly on partition (child table) of
a partitioned table are not supported.<p>For the <codeph>INSERT</codeph> command, you can
specify a leaf child table of the partitioned table to insert data into a partitioned
......@@ -34,9 +34,9 @@
<li>Query plan <cmdname>Partition selector</cmdname> operator.</li>
<li>Query plan <cmdname>Split</cmdname> operator. </li>
</ul></li>
<li>When running <cmdname>EXPLAIN</cmdname>, the query plan generated by GPORCA is different than the plan generated by the legacy query optimizer.</li>
<li>When running <cmdname>EXPLAIN</cmdname>, the query plan generated by GPORCA is different than the plan generated by the Postgres query optimizer.</li>
<li>Greenplum Database adds the log file message <codeph>Planner produced
plan</codeph> when GPORCA is enabled and Greenplum Database falls back to the legacy query optimizer to generate the query
plan</codeph> when GPORCA is enabled and Greenplum Database falls back to the Postgres query optimizer to generate the query
plan.</li>
<li>Greenplum Database issues a warning when statistics are missing from one or
more table columns. When executing an SQL command with GPORCA, Greenplum Database issues a warning if the command performance could be improved by
......
......@@ -3,7 +3,7 @@
<topic id="topic1">
<title>Enabling and Disabling GPORCA</title>
<abstract>
<shortdesc>By default, Greenplum Database uses GPORCA instead of the legacy query planner.
<shortdesc>By default, Greenplum Database uses GPORCA instead of the Postgres query planner.
Server configuration parameters enable or disable GPORCA.</shortdesc>
</abstract>
<body>
......
......@@ -5,7 +5,7 @@
<title>Determining the Query Optimizer that is Used</title>
<abstract>
<shortdesc> When GPORCA is enabled (the default), you can determine if Greenplum Database is
using GPORCA or is falling back to the legacy query optimizer. </shortdesc>
using GPORCA or is falling back to the Postgres query optimizer. </shortdesc>
</abstract>
<body>
<p>You can examine the <codeph>EXPLAIN</codeph> query plan for the query determine which query
......@@ -16,17 +16,17 @@
the end of the query plan. For
example.<codeblock> Settings: <b>optimizer=on</b>
Optimizer status: <b>PQO version 1.584</b></codeblock><p>When
Greenplum Database falls back to the legacy optimizer to generate the
plan, the setting <codeph>optimizer=on</codeph> and <codeph>legacy query
Greenplum Database falls back to the Postgres optimizer to generate the
plan, the setting <codeph>optimizer=on</codeph> and <codeph>Postgres query
optimizer</codeph> are displayed at the end of the query plan. For
example.<codeblock> Settings: <b>optimizer=on</b>
Optimizer status: <b>legacy query optimizer</b></codeblock></p>When
Optimizer status: <b>Postgres query optimizer</b></codeblock></p>When
the server configuration parameter <codeph>OPTIMIZER</codeph> is <codeph>off</codeph>,
these lines are displayed at the end of a query
plan.<codeblock> Settings: <b>optimizer=off</b>
Optimizer status: <b>legacy query optimizer</b></codeblock></li>
Optimizer status: <b>Postgres query optimizer</b></codeblock></li>
<li>These plan items appear only in the <codeph>EXPLAIN</codeph> plan output generated by
GPORCA. The items are not supported in a legacy optimizer query
GPORCA. The items are not supported in a Postgres optimizer query
plan.<ul id="ul_ej2_xbh_1t">
<li>Assert operator</li>
<li>Sequence operator</li>
......@@ -36,12 +36,12 @@
<li>When a query against a partitioned table is generated by GPORCA, the
<codeph>EXPLAIN</codeph> plan displays only the number of partitions that are being
eliminated is listed. The scanned partitions are not shown. The <codeph>EXPLAIN</codeph>
plan generated by the legacy optimizer lists the scanned partitions. </li>
plan generated by the Postgres optimizer lists the scanned partitions. </li>
</ul></p>
<p>The log file contains messages that indicate which query optimizer was used. If Greenplum Database falls back to the legacy optimizer, a message with
<p>The log file contains messages that indicate which query optimizer was used. If Greenplum Database falls back to the Postgres optimizer, a message with
<codeph>NOTICE</codeph> information is added to the log file that indicates the unsupported
feature. Also, the label <codeph>Planner produced plan:</codeph> appears before the query in
the query execution log message when Greenplum Database falls back to the legacy
the query execution log message when Greenplum Database falls back to the Postgres
optimizer. </p>
<note> You can configure Greenplum Database to display log messages on the psql
command line by setting the Greenplum Database server configuration parameter
......@@ -67,8 +67,8 @@
partitions.<codeblock> -> Partition Selector for sales (dynamic scan id: 1) (cost=10.00..100.00 rows=50 width=4)
<b>Partitions selected: 13 (out of 13)</b></codeblock></p>
<p>If a query against a partitioned table is not supported by GPORCA.
Greenplum Database falls back to the legacy optimizer. The
<codeph>EXPLAIN</codeph> plan generated by the legacy optimizer lists the selected
Greenplum Database falls back to the Postgres optimizer. The
<codeph>EXPLAIN</codeph> plan generated by the Postgres optimizer lists the selected
partitions. This example shows a part of the explain plan that lists some selected
partitions.</p>
<p>
......@@ -78,8 +78,8 @@
...</b></codeblock>
</p>
<p>This example shows the log output when the Greenplum Database falls back to
the legacy query optimizer from GPORCA. </p>
<p>When this query is run, Greenplum Database falls back to the legacy query
the Postgres query optimizer from GPORCA. </p>
<p>When this query is run, Greenplum Database falls back to the Postgres query
optimizer.<codeblock>explain select * from pg_class;</codeblock></p>
<p>A message is added to the log file. The message contains this <codeph>NOTICE</codeph>
information that indicates the reason GPORCA did not execute the
......
......@@ -110,7 +110,7 @@ IN (<b>SELECT p_partkey FROM part p2 WHERE p2.p_retailprice = </b>
FROM part p3
WHERE p3.p_brand = p1.p_brand)</b>
);</codeblock><note>Nested
CSQ with skip level correlations are not supported by the legacy query
CSQ with skip level correlations are not supported by the Postgres query
optimizer.</note></li>
<li>CSQ with aggregate and inequality. This example contains a CSQ with an
inequality.<codeblock>SELECT * FROM part p1 WHERE p1.p_retailprice =
......
......@@ -4,7 +4,7 @@
<title>GPORCA Limitations</title>
<abstract>
<shortdesc>There are limitations in Greenplum Database when using the default GPORCA optimizer.
GPORCA and the legacy query optimizer currently coexist in Greenplum Database because GPORCA
GPORCA and the Postgres query optimizer currently coexist in Greenplum Database because GPORCA
does not support all Greenplum Database features. </shortdesc>
</abstract>
<body>
......@@ -63,7 +63,7 @@
overhead due to GPORCA enhancements for determining an optimal query execution
plan.</li>
<li><cmdname>ANALYZE</cmdname> - For GPORCA, the <cmdname>ANALYZE</cmdname> command
generates root partition statistics for partitioned tables. For the legacy optimizer,
generates root partition statistics for partitioned tables. For the Postgres optimizer,
these statistics are not generated.</li>
<li>DML operations - For GPORCA, DML enhancements including the support of updates on
partition and distribution keys might require additional overhead. </li>
......
......@@ -43,7 +43,7 @@
<li><codeph>optimizer_sort_factor</codeph> controls the cost factor that GPORCA applies to
sorting operations during query optimization. The cost factor can be adjusted for queries
when data skew is present. </li>
<li><codeph>gp_enable_relsize_collection</codeph> controls how GPORCA (and the legacy query
<li><codeph>gp_enable_relsize_collection</codeph> controls how GPORCA (and the Postgres query
optimizer) handle a table without statistics. By default, GPORCA uses a default value to
estimate the number of rows if statistics are not available. When this value is
<codeph>on</codeph>, GPORCA uses the estimated size of a table if there are no statistics
......
......@@ -5,7 +5,7 @@
<topic id="topic1">
<title>Overview of GPORCA</title>
<abstract><shortdesc>GPORCA extends the planning and optimization capabilities of the Greenplum
Database legacy optimizer. </shortdesc>GPORCA is extensible and achieves better optimization
Database Postgres optimizer. </shortdesc>GPORCA is extensible and achieves better optimization
in multi-core architecture environments. Greenplum Database uses GPORCA by default to generate
an execution plan for a query when possible.</abstract>
<body>
......@@ -15,15 +15,15 @@
<li>Queries that contain a common table expression (CTE)</li>
<li>Queries that contain subqueries</li>
</ul></p>
<p>In Greenplum Database, GPORCA co-exists with the legacy query optimizer. By default,
Greenplum Database uses GPORCA. If GPORCA cannot be used, then the legacy query optimizer is
<p>In Greenplum Database, GPORCA co-exists with the Postgres query optimizer. By default,
Greenplum Database uses GPORCA. If GPORCA cannot be used, then the Postgres query optimizer is
used. </p>
<p>The following figure shows how GPORCA fits into the query planning
architecture.</p>
<image href="../../graphics/piv-opt.png" id="image_tqw_2bm_vp"/>
<note>All legacy query optimizer (planner) server configuration parameters are ignored by
GPORCA. However, if Greenplum Database falls back to the legacy optimizer, the planner server
configuration parameters will impact the query plan generation. For a list of legacy query
<note>All Postgres query optimizer (planner) server configuration parameters are ignored by
GPORCA. However, if Greenplum Database falls back to the Postgres optimizer, the planner server
configuration parameters will impact the query plan generation. For a list of Postgres query
optimizer (planner) server configuration parameters, see <xref
href="../../../ref_guide/config_params/guc_category-list.xml#topic21">Query Tuning
Parameters</xref>.</note>
......
......@@ -4,7 +4,7 @@
<title>Collecting Root Partition Statistics</title>
<shortdesc>For a partitioned table, GPORCA uses statistics of the table root partition to generate
query plans. These statistics are used for determining the join order, for splitting and joining
aggregate nodes, and for costing the query steps. In contrast, the legacy planner uses the
aggregate nodes, and for costing the query steps. In contrast, the Postgres planner uses the
statistics of each leaf partition.</shortdesc>
<body>
<p>If you execute queries on partitioned tables, you should collect statistics on the root
......@@ -71,7 +71,7 @@
<p>Although creating and maintaining root partition statistics is crucial for GPORCA query
performance with partitioned tables, maintaining leaf partition statistics is also
important. If GPORCA cannot generate a plan for a query against a partitioned table, then
the legacy planner is used and leaf partition statistics are needed to produce the optimal
the Postgres planner is used and leaf partition statistics are needed to produce the optimal
plan for that query. </p>
<p>GPORCA itself also uses leaf partition statistics for any queries that access leaf
partitions directly, instead of using the root partition with predicates to eliminate
......
......@@ -4,7 +4,7 @@
<topic id="topic_i4y_prl_vp">
<title>About GPORCA</title>
<abstract>
<shortdesc>In Greenplum Database, the default GPORCA optmizer co-exists with the legacy query
<shortdesc>In Greenplum Database, the default GPORCA optmizer co-exists with the Postgres query
optimizer. </shortdesc>
</abstract>
<body>
......
......@@ -28,9 +28,9 @@
<codeblock>EXPLAIN ANALYZE SELECT * FROM names WHERE id=22;
</codeblock>
</p>
<note>In Greenplum Database, the default GPORCA optimizer co-exists with the legacy query
<note>In Greenplum Database, the default GPORCA optimizer co-exists with the Postgres query
optimizer. The <cmdname>EXPLAIN</cmdname> output generated by GPORCA is different than the
output generated by the legacy query optimizer. <p>By default, Greenplum Database uses GPORCA
output generated by the Postgres query optimizer. <p>By default, Greenplum Database uses GPORCA
to generate an execution plan for a query when possible. </p><p>When the <codeph>EXPLAIN
ANALYZE</codeph> command uses GPORCA, the <codeph>EXPLAIN</codeph> plan shows only the
number of partitions that are being eliminated. The scanned partitions are not shown. To
......@@ -181,15 +181,15 @@ Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..20.88 rows=1 width=13)
<title>Determining the Query Optimizer</title>
<body>
<p>You can view <cmdname>EXPLAIN</cmdname> output to determine if GPORCA is enabled for
the query plan and whether GPORCA or the legacy query optimizer generated the explain
the query plan and whether GPORCA or the Postgres query optimizer generated the explain
plan. The information appears at the end of the <cmdname>EXPLAIN</cmdname> output. The
<codeph>Settings</codeph> line displays the setting of the server configuration
parameter <codeph>OPTIMIZER</codeph>. The <codeph>Optimizer status</codeph> line
displays whether GPORCA or the legacy query optimizer generated the explain plan.</p>
displays whether GPORCA or the Postgres query optimizer generated the explain plan.</p>
<p>For these two example query plans, GPORCA is enabled, the server
configuration parameter <codeph>OPTIMIZER</codeph> is <codeph>on</codeph>. For the first
plan, GPORCA generated the <cmdname>EXPLAIN</cmdname> plan. For the
second plan, Greenplum Database fell back to the legacy query optimizer to
second plan, Greenplum Database fell back to the Postgres query optimizer to
generate the query plan.</p>
<p>
<codeblock> QUERY PLAN
......@@ -210,7 +210,7 @@ Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..20.88 rows=1 width=13)
-> Aggregate (cost=3518.99..3519.00 rows=1 width=8)
-> Seq Scan on part (cost=0.00..3018.79 rows=100040 width=1)
Settings: <b>optimizer=on</b>
Optimizer status: <b>legacy query optimizer</b>
Optimizer status: <b>Postgres query optimizer</b>
(5 rows)</codeblock>
</p>
<p>For this query, the server configuration parameter <codeph>OPTIMIZER</codeph> is
......@@ -223,7 +223,7 @@ Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..20.88 rows=1 width=13)
-> Aggregate (cost=3518.99..3519.00 rows=1 width=8)
-> Seq Scan on part (cost=0.00..3018.79 rows=100040 width=1)
Settings: <b>optimizer=off</b>
Optimizer status: <b>legacy query optimizer</b>
Optimizer status: <b>Postgres query optimizer</b>
(5 rows)</codeblock></p>
</body>
</topic>
......@@ -238,7 +238,7 @@ Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..20.88 rows=1 width=13)
an operation consumes the majority of query processing time. For example, if an index scan
takes longer than expected, the index could be out-of-date and need to be reindexed. Or,
adjust <codeph>enable_&lt;operator&gt; </codeph>parameters to see if you can force the
legacy query optimizer (planner) to choose a different plan by disabling a particular
Postgres query optimizer (planner) to choose a different plan by disabling a particular
query plan operator for that query.</li>
<li id="in182538"><b>Are the optimizer's estimates close to reality?</b> Run <codeph>EXPLAIN
ANALYZE</codeph> and see if the number of rows the optimizer estimates is close to the
......@@ -258,7 +258,7 @@ Gather Motion 2:1 (slice1; segments: 2) (cost=0.00..20.88 rows=1 width=13)
join order. Joins that eliminate the largest number of rows should be done earlier in the
plan so fewer rows move up the plan tree. <p>If the plan is not choosing the optimal join
order, set <codeph>join_collapse_limit=1</codeph> and use explicit <codeph>JOIN</codeph>
syntax in your SQL statement to force the legacy query optimizer (planner) to the
syntax in your SQL statement to force the Postgres query optimizer (planner) to the
specified join order. You can also collect more statistics on the relevant join columns.
</p><p>See the <codeph>ANALYZE</codeph> command in the <i>Greenplum
Database Reference Guide</i> for more information collecting statistics.</p></li>
......
......@@ -74,15 +74,15 @@
exceeds the <codeph>MAX_COST</codeph> value set for the resource queue, the query is
rejected as too expensive.</pd>
<pd>
<note>GPORCA and the legacy Greenplum Database query optimizer utilize different
<note>GPORCA and the Postgres query optimizer utilize different
query costing models and may compute different costs for the same query.
The Greenplum Database resource queue resource management scheme neither
differentiates nor aligns costs between GPORCA and the legacy optimizer; it
differentiates nor aligns costs between GPORCA and the Postgres optimizer; it
uses the literal cost value returned from the optimizer to throttle
queries.<p> When resource queue-based resource management is active, use the
<codeph>MEMORY_LIMIT</codeph> and <codeph>ACTIVE_STATEMENTS</codeph> limits for
resource queues rather than configuring cost-based limits. Even when using GPORCA,
Greenplum Database may fall back to using the legacy query optimizer for certain
Greenplum Database may fall back to using the Postgres query optimizer for certain
queries, so using cost-based limits can lead to unexpected results.</p></note>
</pd>
</plentry>
......
......@@ -373,10 +373,10 @@
<abstract>These parameters control aspects of SQL query processing such as query operators and
operator settings and statistics sampling.</abstract>
<topic id="topic22" xml:lang="en">
<title>Legacy Query Optimizer Operator Control Parameters</title>
<title>Postgres Query Optimizer Operator Control Parameters</title>
<body>
<p>The following parameters control the types of plan operations the legacy query optimizer
can use. Enable or disable plan operations to force the legacy optimizer to choose a
<p>The following parameters control the types of plan operations the Postgres query optimizer
can use. Enable or disable plan operations to force the Postgres optimizer to choose a
different plan. This is useful for testing and comparing query performance using different
plan types.</p>
<simpletable id="kh158625" frame="none">
......@@ -470,7 +470,7 @@
</body>
</topic>
<topic id="topic23" xml:lang="en">
<title>Legacy Query Optimizer Costing Parameters</title>
<title>Postgres Query Optimizer Costing Parameters</title>
<body>
<note type="warning">Do not adjust these query costing parameters. They are tuned to reflect
Greenplum Database hardware configurations and typical workloads. All of these parameters
......@@ -635,7 +635,7 @@
</body>
</topic>
<topic id="topic28" xml:lang="en">
<title>Other Legacy Query Optimizer Configuration Parameters</title>
<title>Other Postgres Query Optimizer Configuration Parameters</title>
<body>
<simpletable id="d1e746" frame="none">
<strow>
......
......@@ -102,13 +102,13 @@
<p>GPORCA and the legacy Greenplum Database query optimizer utilize different
query costing models and may compute different costs for the same query.
The Greenplum Database resource queue resource management scheme neither
differentiates nor aligns costs between GPORCA and the legacy optimizer; it
differentiates nor aligns costs between GPORCA and the Postgres optimizer; it
uses the literal cost value returned from the optimizer to throttle
queries.</p>
<p>When resource queue-based resource management is active, use the
<codeph>MEMORY_LIMIT</codeph> and <codeph>ACTIVE_STATEMENTS</codeph> limits for
resource queues rather than configuring cost-based limits. Even when using GPORCA,
Greenplum Database may fall back to using the legacy query optimizer for certain
Greenplum Database may fall back to using the Postgres query optimizer for certain
queries, so using cost-based limits can lead to unexpected results.</p>
</section>
<section id="section6">
......
......@@ -248,8 +248,8 @@ ANALYZE [VERBOSE] ROOTPARTITION {ALL | <varname>root_partition</varname> [ (<var
statistics. </p>
<p>If there are no statistics for the table, the server configuration parameter <codeph><xref
href="../config_params/guc-list.xml#gp_enable_relsize_collection"/></codeph> controls
whether the legacy query optimizer uses a default statistics file or estimates the size of a
table using the <codeph>pg_relation_size</codeph> function. By default, the legacy optimizer
whether the Postgres query optimizer uses a default statistics file or estimates the size of a
table using the <codeph>pg_relation_size</codeph> function. By default, the Postgres optimizer
uses the default statistics file to estimate the number of rows if statistics are not
available.</p>
</section>
......
......@@ -427,7 +427,7 @@ $SomeTag$Dianne's horse$SomeTag$</codeblock>
<li>The function cannot be in the <codeph>FROM</codeph> clause of a query.</li>
<li>The function cannot be in the <codeph>SELECT</codeph> list of a query with a
<codeph>FROM</codeph> clause.</li>
<li>A query that includes the function falls back from GPORCA to the legacy
<li>A query that includes the function falls back from GPORCA to the Postgres
query planner.</li>
</ul></sectiondiv></section>
<section id="section8"><title>Examples</title><p>A very simple addition
......
......@@ -45,15 +45,15 @@
exceed the cost limit will always be rejected and never allowed to run. Specifying a value
for <codeph>MIN_COST</codeph> allows the administrator to define a cost for small queries
that will be exempt from resource queueing.</p>
<note>GPORCA and the legacy Greenplum Database query optimizer utilize different
<note>GPORCA and the Postgres query optimizer utilize different
query costing models and may compute different costs for the same query.
The Greenplum Database resource queue resource management scheme neither
differentiates nor aligns costs between GPORCA and the legacy optimizer; it
differentiates nor aligns costs between GPORCA and the Postgres optimizer; it
uses the literal cost value returned from the optimizer to throttle
queries.<p> When resource queue-based resource management is active, use the
<codeph>MEMORY_LIMIT</codeph> and <codeph>ACTIVE_STATEMENTS</codeph> limits for
resource queues rather than configuring cost-based limits. Even when using GPORCA,
Greenplum Database may fall back to using the legacy query optimizer for certain
Greenplum Database may fall back to using the Postgres query optimizer for certain
queries, so using cost-based limits can lead to unexpected results.</p></note>
<p>If a value is not defined for <codeph>ACTIVE_STATEMENTS</codeph> or
<codeph>MAX_COST</codeph>, it is set to <codeph>-1</codeph> by default (meaning no limit).
......
......@@ -780,7 +780,7 @@ CREATE [ [GLOBAL | LOCAL] {TEMPORARY | TEMP} | UNLOGGED ] TABLE [IF NOT EXISTS]
href="../../ref_guide/config_params/guc-list.xml#gp_default_storage_options"
>gp_default_storage_options</xref></codeph>.</p></li>
</ul>
<note type="important">The current Greenplum Database legacy optimizer allows list partitions
<note type="important">The current Greenplum Database Postgres optimizer allows list partitions
with multi-column (composite) partition keys. GPORCA does not support composite keys, so
using composite partition keys is not recommended.</note>
</section>
......
......@@ -163,10 +163,10 @@
table distribution policy if the <cmdname>DISTRIBUTED BY</cmdname> clause is not
specified when you create a table. Greenplum Database follows these rules to create a
table if a distribution policy is not specified.<ul id="ul_ejv_m1b_kr">
<li>If the legacy query optimizer creates the table, and the value of the parameter is
<li>If the Postgres query optimizer creates the table, and the value of the parameter is
<codeph>off</codeph>, the table distribution policy is determined based on the
command.</li>
<li>If the legacy query optimizer creates the table, and the value of the parameter is
<li>If the Postgres query optimizer creates the table, and the value of the parameter is
<codeph>on</codeph>, the table distribution policy is random.</li>
<li>If GPORCA creates the table, the table distribution policy is random. The
parameter value has no effect. </li>
......@@ -174,7 +174,7 @@
<pd>For more information about setting the default table distribution policy, see <xref
href="../config_params/guc-list.xml#gp_create_table_random_default_distribution"
><codeph>gp_create_table_random_default_distribution</codeph></xref>. For
information about the legacy query optimizer and GPORCA, see <xref
information about the Postgres query optimizer and GPORCA, see <xref
href="../../admin_guide/query/topics/query.xml#topic1">Querying Data</xref> in the
<cite>Greenplum Database Administrator Guide</cite>.</pd>
</plentry>
......
......@@ -1425,7 +1425,7 @@ process_targetlist_for_splitupdate(Relation resultRel, List *targetlist,
}
/*
* In legacy planner, we add a SplitUpdate node at top so that updating on distribution
* In Postgres planner, we add a SplitUpdate node at top so that updating on distribution
* columns could be handled. The SplitUpdate will split each update into delete + insert.
*
* There are several important points should be highlighted:
......
......@@ -644,7 +644,7 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
ExplainOpenGroup("Settings", "Settings", true, es);
if (queryDesc->plannedstmt->planGen == PLANGEN_PLANNER)
ExplainProperty("Optimizer", "legacy query optimizer", false, es);
ExplainProperty("Optimizer", "Postgres query optimizer", false, es);
#ifdef USE_ORCA
else
ExplainPropertyStringInfo("Optimizer", es, "PQO version %s", OptVersion());
......
......@@ -14862,7 +14862,7 @@ ATExecExpandTableCTAS(AlterTableCmd *rootCmd, Relation rel, AlterTableCmd *cmd)
/* Step (a) */
/*
* Force the use of legacy query optimizer, since PQO will not
* Force the use of Postgres query optimizer, since PQO will not
* redistribute the tuples if the current and required distributions
* are both RANDOM even when reorganize is set to "true"
*/
......@@ -15376,7 +15376,7 @@ ATExecSetDistributedBy(Relation rel, Node *node, AlterTableCmd *cmd)
ldistro = make_distributedby_for_rel(rel);
/*
* Force the use of legacy query optimizer, since PQO will not
* Force the use of Postgres query optimizer, since PQO will not
* redistribute the tuples if the current and required distributions
* are both RANDOM even when reorganize is set to "true"
*/
......@@ -15385,7 +15385,7 @@ ATExecSetDistributedBy(Relation rel, Node *node, AlterTableCmd *cmd)
if (saveOptimizerGucValue)
ereport(LOG,
(errmsg("ALTER SET DISTRIBUTED BY: falling back to legacy query optimizer to ensure re-distribution of tuples.")));
(errmsg("ALTER SET DISTRIBUTED BY: falling back to Postgres query optimizer to ensure re-distribution of tuples.")));
GpPolicy *original_policy = NULL;
......
......@@ -300,7 +300,7 @@ shouldPickInstrInShmem(NodeTag tag)
case T_SeqScan:
/*
* If table has many partitions, legacy planner will generate a
* If table has many partitions, Postgres planner will generate a
* plan with many SCAN nodes under a APPEND node. If the number of
* partitions are too many, this plan will occupy too many slots.
* Here is a limitation on number of shmem slots used by scan
......
......@@ -2045,7 +2045,7 @@ no_unique_path: /* failure exit */
* -> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..8.00 rows=100 width=18)
* -> Seq Scan on s (cost=0.00..4.00 rows=34 width=18)
* Settings: optimizer=off
* Optimizer status: legacy query optimizer
* Optimizer status: Postgres query optimizer
* (14 rows)
*
*
......
......@@ -18,7 +18,7 @@ Gather Motion 3:1 (slice1; segments: 3)
Sort Key: id
-> Index Scan using test_dc_data on test_dc
Index Cond: (data = 34)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
step explains: EXPLAIN (COSTS OFF) EXECUTE getrow_seq;
QUERY PLAN
......@@ -28,7 +28,7 @@ Gather Motion 3:1 (slice1; segments: 3)
Sort Key: id, data
-> Seq Scan on test_dc
Filter: ((data)::text = '34'::text)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
step select2: SELECT * FROM test_dc WHERE data=34 ORDER BY id,data;
id data
......
......@@ -158,7 +158,7 @@ EXPLAIN SELECT n FROM ao_upgrade_test WHERE n = (9 !);
-> Bitmap Index Scan on ao_bitmap_index (cost=0.00..1000.36 rows=1 width=0)
Index Cond: n = 362880::numeric
Settings: enable_seqscan=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
EXPLAIN SELECT n FROM aocs_upgrade_test WHERE n = (9 !);
QUERY PLAN
......@@ -169,7 +169,7 @@ EXPLAIN SELECT n FROM aocs_upgrade_test WHERE n = (9 !);
-> Bitmap Index Scan on aocs_bitmap_index (cost=0.00..1000.36 rows=1 width=0)
Index Cond: n = 362880::numeric
Settings: enable_seqscan=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
EXPLAIN SELECT n FROM aocs_rle_upgrade_test WHERE n = (9 !);
QUERY PLAN
......@@ -180,7 +180,7 @@ EXPLAIN SELECT n FROM aocs_rle_upgrade_test WHERE n = (9 !);
-> Bitmap Index Scan on aocs_rle_bitmap_index (cost=0.00..1000.36 rows=1 width=0)
Index Cond: n = 362880::numeric
Settings: enable_seqscan=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
SELECT n FROM ao_upgrade_test WHERE n = (9 !);
......
......@@ -158,7 +158,7 @@ EXPLAIN SELECT n FROM ao_upgrade_test WHERE n = (9 !);
-> Bitmap Index Scan on ao_bitmap_index (cost=0.00..1000.36 rows=1 width=0)
Index Cond: n = 362880::numeric
Settings: enable_seqscan=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
EXPLAIN SELECT n FROM aocs_upgrade_test WHERE n = (9 !);
QUERY PLAN
......@@ -169,7 +169,7 @@ EXPLAIN SELECT n FROM aocs_upgrade_test WHERE n = (9 !);
-> Bitmap Index Scan on aocs_bitmap_index (cost=0.00..1000.36 rows=1 width=0)
Index Cond: n = 362880::numeric
Settings: enable_seqscan=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
EXPLAIN SELECT n FROM aocs_rle_upgrade_test WHERE n = (9 !);
QUERY PLAN
......@@ -180,7 +180,7 @@ EXPLAIN SELECT n FROM aocs_rle_upgrade_test WHERE n = (9 !);
-> Bitmap Index Scan on aocs_rle_bitmap_index (cost=0.00..1000.36 rows=1 width=0)
Index Cond: n = 362880::numeric
Settings: enable_seqscan=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
SELECT n FROM ao_upgrade_test WHERE n = (9 !);
......
......@@ -70,7 +70,7 @@ explain update s set b = b + 1 where exists (select 1 from r where s.a = r.b);
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..8.00 rows=100 width=18)
-> Seq Scan on s (cost=0.00..4.00 rows=34 width=18)
Planning time: 1.342 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
update s set b = b + 1 where exists (select 1 from r where s.a = r.b);
......@@ -90,7 +90,7 @@ explain delete from s where exists (select 1 from r where s.a = r.b);
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..8.00 rows=100 width=14)
-> Seq Scan on s (cost=0.00..4.00 rows=34 width=14)
Planning time: 1.130 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
delete from s where exists (select 1 from r where s.a = r.b);
......
......@@ -392,7 +392,7 @@ order by 1, 2;
-> Function Scan on pg_catalog.generate_series s2
Output: s2.s2
Function Call: generate_series(1, 3)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
select s1, s2, sm
......@@ -596,7 +596,7 @@ explain (costs off)
Merge Key: tenk1.unique1
-> Index Only Scan using tenk1_unique1 on tenk1
Index Cond: (unique1 IS NOT NULL)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select min(unique1) from tenk1;
......@@ -616,7 +616,7 @@ explain (costs off)
Merge Key: tenk1.unique1
-> Index Only Scan Backward using tenk1_unique1 on tenk1
Index Cond: (unique1 IS NOT NULL)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select max(unique1) from tenk1;
......@@ -636,7 +636,7 @@ explain (costs off)
Merge Key: tenk1.unique1
-> Index Only Scan Backward using tenk1_unique1 on tenk1
Index Cond: ((unique1 IS NOT NULL) AND (unique1 < 42))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select max(unique1) from tenk1 where unique1 < 42;
......@@ -656,7 +656,7 @@ explain (costs off)
Merge Key: tenk1.unique1
-> Index Only Scan Backward using tenk1_unique1 on tenk1
Index Cond: ((unique1 IS NOT NULL) AND (unique1 > 42))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select max(unique1) from tenk1 where unique1 > 42;
......@@ -678,7 +678,7 @@ explain (costs off)
Merge Key: tenk1.unique1
-> Index Only Scan Backward using tenk1_unique1 on tenk1
Index Cond: ((unique1 IS NOT NULL) AND (unique1 > 42000))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select max(unique1) from tenk1 where unique1 > 42000;
......@@ -700,7 +700,7 @@ explain (costs off)
Merge Key: tenk1.tenthous
-> Index Only Scan Backward using tenk1_thous_tenthous on tenk1
Index Cond: ((thousand = 33) AND (tenthous IS NOT NULL))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select max(tenthous) from tenk1 where thousand = 33;
......@@ -720,7 +720,7 @@ explain (costs off)
Merge Key: tenk1.tenthous
-> Index Only Scan using tenk1_thous_tenthous on tenk1
Index Cond: ((thousand = 33) AND (tenthous IS NOT NULL))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select min(tenthous) from tenk1 where thousand = 33;
......@@ -746,7 +746,7 @@ explain (costs off)
-> Materialize
-> Broadcast Motion 3:3 (slice1; segments: 3)
-> Seq Scan on tenk1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select f1, (select min(unique1) from tenk1 where unique1 > f1) AS gt
......@@ -774,7 +774,7 @@ explain (costs off)
-> Index Only Scan Backward using tenk1_unique2 on tenk1
Index Cond: (unique2 IS NOT NULL)
-> Result
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select distinct max(unique2) from tenk1;
......@@ -796,7 +796,7 @@ explain (costs off)
-> Index Only Scan Backward using tenk1_unique2 on tenk1
Index Cond: (unique2 IS NOT NULL)
-> Result
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select max(unique2) from tenk1 order by 1;
......@@ -818,7 +818,7 @@ explain (costs off)
-> Index Only Scan Backward using tenk1_unique2 on tenk1
Index Cond: (unique2 IS NOT NULL)
-> Result
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select max(unique2) from tenk1 order by max(unique2);
......@@ -840,7 +840,7 @@ explain (costs off)
-> Index Only Scan Backward using tenk1_unique2 on tenk1
Index Cond: (unique2 IS NOT NULL)
-> Result
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select max(unique2) from tenk1 order by max(unique2)+1;
......@@ -862,7 +862,7 @@ explain (costs off)
-> Index Only Scan Backward using tenk1_unique2 on tenk1
Index Cond: (unique2 IS NOT NULL)
-> Result
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select max(unique2), generate_series(1,3) as g from tenk1 order by g desc;
......@@ -920,7 +920,7 @@ explain (costs off)
Index Cond: (f1 IS NOT NULL)
-> Index Only Scan Backward using minmaxtest3i on minmaxtest3 minmaxtest3_1
Index Cond: (f1 IS NOT NULL)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(30 rows)
select min(f1), max(f1) from minmaxtest;
......@@ -945,7 +945,7 @@ explain (costs off)
-> Seq Scan on minmaxtest1
-> Seq Scan on minmaxtest2
-> Seq Scan on minmaxtest3
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
select distinct min(f1), max(f1) from minmaxtest;
......
......@@ -408,7 +408,7 @@ DETAIL: Feature not supported: LATERAL
-> Function Scan on pg_catalog.generate_series s2
Output: s2.s2
Function Call: generate_series(1, 3)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
select s1, s2, sm
......@@ -452,7 +452,7 @@ DETAIL: Feature not supported: Non-Scalar Subquery
-> Function Scan on pg_catalog.generate_series y
Output: y.y
Function Call: generate_series(1, 3)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
select array(select sum(x+y) s
......@@ -927,7 +927,7 @@ DETAIL: Feature not supported: Inherited tables
Index Cond: (f1 IS NOT NULL)
-> Index Only Scan Backward using minmaxtest3i on minmaxtest3 minmaxtest3_1
Index Cond: (f1 IS NOT NULL)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(30 rows)
select min(f1), max(f1) from minmaxtest;
......@@ -956,7 +956,7 @@ DETAIL: Feature not supported: Inherited tables
-> Seq Scan on minmaxtest1
-> Seq Scan on minmaxtest2
-> Seq Scan on minmaxtest3
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
select distinct min(f1), max(f1) from minmaxtest;
......
......@@ -478,7 +478,7 @@ explain (costs off) select * from nv_parent where d between '2011-08-01' and '20
Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
-> Seq Scan on nv_child_2011
Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
create table nv_child_2009 (check (d between '2009-01-01'::date and '2009-12-31'::date)) inherits (nv_parent);
......@@ -493,7 +493,7 @@ explain (costs off) select * from nv_parent where d between '2011-08-01'::date a
Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
-> Seq Scan on nv_child_2011
Filter: ((d >= '08-01-2011'::date) AND (d <= '08-31-2011'::date))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off) select * from nv_parent where d between '2009-08-01'::date and '2009-08-31'::date;
......@@ -509,7 +509,7 @@ explain (costs off) select * from nv_parent where d between '2009-08-01'::date a
Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
-> Seq Scan on nv_child_2009
Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
-- after validation, the constraint should be used
......@@ -525,7 +525,7 @@ explain (costs off) select * from nv_parent where d between '2009-08-01'::date a
Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
-> Seq Scan on nv_child_2009
Filter: ((d >= '08-01-2009'::date) AND (d <= '08-31-2009'::date))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
-- add an inherited NOT VALID constraint
......@@ -2230,7 +2230,7 @@ explain (verbose, costs off) select * from at_view_2;
Output: bt.id, bt.stuff, (to_json(ROW(bt.id, bt.stuff)))
-> Seq Scan on public.at_base_table bt
Output: bt.id, bt.stuff, to_json(ROW(bt.id, bt.stuff))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: constraint_exclusion=partition
(6 rows)
......@@ -2274,7 +2274,7 @@ explain (verbose, costs off) select * from at_view_2;
Output: bt.id, bt.stuff, (to_json(ROW(bt.id, bt.stuff, NULL)))
-> Seq Scan on public.at_base_table bt
Output: bt.id, bt.stuff, to_json(ROW(bt.id, bt.stuff, NULL))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: constraint_exclusion=partition
(6 rows)
......
......@@ -1599,7 +1599,7 @@ EXPLAIN SELECT count(unnest(foo)) FROM tbl_agg_srf;
-> Gather Motion 3:1 (slice1; segments: 3) (cost=1.02..1.07 rows=1 width=8)
-> Aggregate (cost=1.02..1.03 rows=1 width=8)
-> Seq Scan on tbl_agg_srf (cost=0.00..1.01 rows=1 width=33)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
SELECT count(unnest(foo)) FROM tbl_agg_srf;
......
......@@ -1599,7 +1599,7 @@ EXPLAIN SELECT count(unnest(foo)) FROM tbl_agg_srf;
-> Gather Motion 3:1 (slice1; segments: 3) (cost=1.02..1.07 rows=1 width=8)
-> Aggregate (cost=1.02..1.03 rows=1 width=8)
-> Seq Scan on tbl_agg_srf (cost=0.00..1.01 rows=1 width=33)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
SELECT count(unnest(foo)) FROM tbl_agg_srf;
......
......@@ -258,7 +258,7 @@ explain select pg_column_size('mpp_bfv_2');
------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0)
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(3 rows)
explain select pg_lock_status();
......@@ -266,7 +266,7 @@ explain select pg_lock_status();
------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0)
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(3 rows)
select pg_get_constraintdef(pg_constraint.oid) from pg_constraint, pg_class where conrelid=pg_class.oid and pg_class.relname='mpp_bfv_2';
......
......@@ -186,7 +186,7 @@ explain update update_pk_test set b = 5;
Update on update_pk_test (cost=0.00..1.01 rows=1 width=14)
-> Seq Scan on update_pk_test (cost=0.00..1.01 rows=1 width=14)
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(4 rows)
update update_pk_test set b = 5;
......@@ -204,7 +204,7 @@ explain update update_pk_test set a = 5;
Hash Key: a
-> Split (cost=0.00..1.01 rows=1 width=14)
-> Seq Scan on update_pk_test (cost=0.00..1.01 rows=1 width=14)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
update update_pk_test set a = 5;
......
......@@ -30,7 +30,7 @@ explain select * from bfv_tab1, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i
-> Seq Scan on bfv_tab1 (cost=0.00..219.00 rows=3967 width=244)
-> Hash (cost=0.03..0.03 rows=1 width=36)
-> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=1 width=36)
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
set gp_enable_relsize_collection=on;
......@@ -45,7 +45,7 @@ explain select * from bfv_tab1, (values(147, 'RFAAAA'), (931, 'VJAAAA')) as v (i
-> Hash (cost=0.00..0.00 rows=1 width=244)
-> Seq Scan on bfv_tab1 (cost=0.00..0.00 rows=1 width=244)
Settings: gp_enable_relsize_collection=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
reset gp_enable_relsize_collection;
......@@ -184,7 +184,7 @@ AND ft.id = dt1.id;
-> Seq Scan on bfv_tab2_dimtabl1 dt1 (cost=0.00..3.07 rows=3 width=4)
-> Hash (cost=3.10..3.10 rows=4 width=2)
-> Seq Scan on bfv_tab2_dimdate dt (cost=0.00..3.10 rows=4 width=2)
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(36 rows)
-- start_ignore
......@@ -460,7 +460,7 @@ explain select * from tbl_ab where b::oid=1;
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..1176.25 rows=87 width=8)
-> Seq Scan on tbl_ab (cost=0.00..1176.25 rows=29 width=8)
Filter: b::oid = 1::oid
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(4 rows)
drop table tbl_ab;
......@@ -507,7 +507,7 @@ explain select * from nestloop_x as x, nestloop_y as y where x.i + x.j < y.j;
-> Index Scan using nestloop_y_idx on nestloop_y y (cost=0.00..510.39 rows=1 width=8)
Index Cond: (x.i + x.j) < y.j
Settings: enable_indexscan=on; enable_nestloop=on; optimizer=off; seq_page_cost=1e+07
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
select * from nestloop_x as x, nestloop_y as y where x.i + x.j < y.j;
......@@ -534,7 +534,7 @@ explain select * from nestloop_x as x, nestloop_y as y where y.j > x.i + x.j + 2
-> Index Scan using nestloop_y_idx on nestloop_y y (cost=0.00..510.39 rows=1 width=8)
Index Cond: y.j > (x.i + x.j + 2)
Settings: enable_indexscan=on; enable_nestloop=on; optimizer=off; seq_page_cost=1e+07
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
select * from nestloop_x as x, nestloop_y as y where y.j > x.i + x.j + 2;
......@@ -603,7 +603,7 @@ explain select * from shape_heap where c && '<(5,5), 1>'::circle;
Recheck Cond: c && '<(5,5),1>'::circle
-> Bitmap Index Scan on shape_heap_bb_idx (cost=0.00..101.26 rows=1 width=0)
Index Cond: c && '<(5,5),1>'::circle
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
explain select * from shape_ao where c && '<(5,5), 1>'::circle;
......@@ -614,7 +614,7 @@ explain select * from shape_ao where c && '<(5,5), 1>'::circle;
Recheck Cond: c && '<(5,5),1>'::circle
-> Bitmap Index Scan on shape_ao_bb_idx (cost=0.00..101.26 rows=1 width=0)
Index Cond: c && '<(5,5),1>'::circle
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
explain select * from shape_aocs where c && '<(5,5), 1>'::circle;
......@@ -625,7 +625,7 @@ explain select * from shape_aocs where c && '<(5,5), 1>'::circle;
Recheck Cond: c && '<(5,5),1>'::circle
-> Bitmap Index Scan on shape_aocs_bb_idx (cost=0.00..101.26 rows=1 width=0)
Index Cond: c && '<(5,5),1>'::circle
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
-- Test that they return correct results.
......
......@@ -447,7 +447,7 @@ explain select * from tbl_ab where b::oid=1;
-> Seq Scan on tbl_ab (cost=0.00..1176.25 rows=29 width=8)
Filter: b::oid = 1::oid
Settings: optimizer=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
drop table tbl_ab;
......
......@@ -669,7 +669,7 @@ explain select 1 as mrs_t1 where 1 <= ALL (select x from z);
-> Materialize (cost=0.00..0.01 rows=1 width=4)
-> Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..0.00 rows=1 width=4)
-> Seq Scan on z (cost=0.00..0.00 rows=1 width=4)
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
--
......@@ -3091,7 +3091,7 @@ ON (member_group.group_id IN (12,13,14,15) AND member_subgroup.subgroup_name = r
-> Redistribute Motion 3:3 (slice4; segments: 3)
Hash Key: region.county_name
-> Seq Scan on region
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(23 rows)
-- Test colocated equijoins on coerced distribution keys
......@@ -3107,7 +3107,7 @@ EXPLAIN (costs off) SELECT * FROM coercejoin a, coercejoin b WHERE a.a=b.a;
-> Seq Scan on coercejoin a
-> Hash
-> Seq Scan on coercejoin b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- Negative test, the join should not be colocated since the cast is a coercion
......@@ -3126,7 +3126,7 @@ EXPLAIN (costs off) SELECT * FROM coercejoin a, coercejoin b WHERE a.a::numeric=
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (b.a)::numeric
-> Seq Scan on coercejoin b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
--
......@@ -3151,7 +3151,7 @@ explain select * from nlj1, nlj2 where nlj1.a = nlj2.a;
-> Seq Scan on nlj1 (cost=0.00..2.02 rows=1 width=8)
-> Materialize (cost=0.00..2.03 rows=1 width=8)
-> Seq Scan on nlj2 (cost=0.00..2.02 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select * from nlj1, nlj2 where nlj1.a = nlj2.a;
......@@ -3170,7 +3170,7 @@ explain select * from nlj1, nlj2 where nlj1.a is not distinct from nlj2.a;
-> Materialize (cost=0.00..2.13 rows=2 width=8)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.10 rows=2 width=8)
-> Seq Scan on nlj2 (cost=0.00..2.02 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select * from nlj1, nlj2 where nlj1.a is not distinct from nlj2.a;
......@@ -3190,7 +3190,7 @@ explain select * from nlj1, (select NULL a, b from nlj2) other where nlj1.a is n
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.06 rows=1 width=8)
-> Seq Scan on nlj1 (cost=0.00..2.02 rows=1 width=8)
Filter: (NOT (a IS DISTINCT FROM NULL::integer))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select * from nlj1, (select NULL a, b from nlj2) other where nlj1.a is not distinct from other.a;
......@@ -3210,7 +3210,7 @@ explain select * from nlj1, nlj2 where nlj1.a is distinct from nlj2.a;
-> Materialize (cost=0.00..2.13 rows=2 width=8)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.10 rows=2 width=8)
-> Seq Scan on nlj2 (cost=0.00..2.02 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
select * from nlj1, nlj2 where nlj1.a is distinct from nlj2.a;
......@@ -3267,7 +3267,7 @@ set enable_nestloop=on;
-- -> Seq Scan on a
-- -> Index Only Scan using c_i_j_idx on c
-- Index Cond: (j = (a.i + b.i)) [4]
-- Optimizer: legacy query optimizer
-- Optimizer: Postgres query optimizer
-- (14 rows)
--
-- The crucal parts are:
......@@ -3301,7 +3301,7 @@ explain (costs off) select * from a, b, c where b.i = a.i and (a.i + b.i) = c.j;
-> Seq Scan on a
-> Index Only Scan using c_i_j_idx on c
Index Cond: (j = (a.i + b.i))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
select * from a, b, c where b.i = a.i and (a.i + b.i) = c.j;
......
......@@ -3265,7 +3265,7 @@ set enable_nestloop=on;
-- -> Seq Scan on a
-- -> Index Only Scan using c_i_j_idx on c
-- Index Cond: (j = (a.i + b.i)) [4]
-- Optimizer: legacy query optimizer
-- Optimizer: Postgres query optimizer
-- (14 rows)
--
-- The crucal parts are:
......
......@@ -1150,7 +1150,7 @@ EXPLAIN SELECT b FROM bar GROUP BY b;
-> Append (cost=0.00..16.00 rows=334 width=4)
-> Seq Scan on bar_1_prt_1 (cost=0.00..8.00 rows=167 width=4)
-> Seq Scan on bar_1_prt_2 (cost=0.00..8.00 rows=167 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- CLEANUP
......@@ -1198,7 +1198,7 @@ explain analyze select a.* from mpp8031 a, mpp8031 b where a.oid = b.oid;
(slice0) Executor memory: 386K bytes.
(slice1) Executor memory: 142K bytes avg x 3 workers, 142K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 4.237 ms
(19 rows)
......@@ -1243,7 +1243,7 @@ EXPLAIN SELECT * FROM part_tbl WHERE profile_key = 99999999;
Filter: profile_key = 99999999::numeric
-> Seq Scan on part_tbl_1_prt_p20151110_2_prt_other_services (cost=0.00..1.01 rows=1 width=25)
Filter: profile_key = 99999999::numeric
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
SELECT * FROM part_tbl WHERE profile_key = 99999999;
......@@ -1330,7 +1330,7 @@ explain select * from r_part r1, r_part r2 where r1.a=1; -- should eliminate par
-> Seq Scan on r_part_1_prt_7 r2_6 (cost=0.00..1.00 rows=1 width=8)
-> Seq Scan on r_part_1_prt_8 r2_7 (cost=0.00..1.00 rows=1 width=8)
-> Seq Scan on r_part_1_prt_9 r2_8 (cost=0.00..1.00 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(18 rows)
-- the numbers in the filter should be both on segment 0
......@@ -1343,7 +1343,7 @@ explain select * from r_part where a in (7,8); -- should eliminate partitions
Filter: a = ANY ('{7,8}'::integer[])
-> Seq Scan on r_part_1_prt_8 (cost=0.00..1.01 rows=1 width=8)
Filter: a = ANY ('{7,8}'::integer[])
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- Test partition elimination in prepared statements
......@@ -1377,7 +1377,7 @@ explain select * from r_part where a = 1 order by a,b; -- should eliminate parti
-> Append (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on r_part_1_prt_1 (cost=0.00..1.01 rows=1 width=8)
Filter: a = 1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
--force_explain
......@@ -1391,7 +1391,7 @@ explain execute f1(1); -- should eliminate partitions
-> Append (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on r_part_1_prt_1 (cost=0.00..1.01 rows=1 width=8)
Filter: a = 1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
--force_explain
......@@ -1405,7 +1405,7 @@ explain execute f2(2); -- should eliminate partitions
-> Append (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on r_part_1_prt_2 (cost=0.00..1.01 rows=1 width=8)
Filter: a = 2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
-- Test partition elimination on CO tables
......@@ -1418,7 +1418,7 @@ explain select * from r_co where a=2; -- should eliminate partitions
-> Append (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on r_co_1_prt_2 (cost=0.00..1.01 rows=1 width=8)
Filter: a = 2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
-- test partition elimination in prepared statements on CO tables
......@@ -1434,7 +1434,7 @@ explain execute f3(2); -- should eliminate partitions
-> Append (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on r_co_1_prt_2 (cost=0.00..1.01 rows=1 width=8)
Filter: a = 2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
-- start_ignore
......@@ -1472,7 +1472,7 @@ explain select * from fact where dd < '2009-01-02'::date; -- partitions eliminat
-> Append (cost=0.00..1.00 rows=1 width=40)
-> Seq Scan on fact_1_prt_1 (cost=0.00..1.00 rows=1 width=40)
Filter: dd < '01-02-2009'::date
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
explain select * from fact where dd < to_date('2009-01-02','YYYY-MM-DD'); -- partitions eliminated
......@@ -1482,7 +1482,7 @@ explain select * from fact where dd < to_date('2009-01-02','YYYY-MM-DD'); -- par
-> Append (cost=0.00..1.00 rows=1 width=40)
-> Seq Scan on fact_1_prt_1 (cost=0.00..1.00 rows=1 width=40)
Filter: dd < '01-02-2009'::date
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
explain select * from fact where dd < current_date; --partitions eliminated
......@@ -1493,7 +1493,7 @@ explain select * from fact where dd < current_date; --partitions eliminated
-> Seq Scan on fact_1_prt_1 (cost=0.00..1.00 rows=1 width=40)
Filter: dd < '10-22-2017'::date
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(6 rows)
-- Test partition elimination in prepared statements
......@@ -1506,7 +1506,7 @@ explain execute f1('2009-01-02'::date); -- should eliminate partitions
-> Append (cost=0.00..1.00 rows=1 width=40)
-> Seq Scan on fact_1_prt_1 (cost=0.00..1.00 rows=1 width=40)
Filter: dd < '01-02-2009'::date
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
-- force_explain
......@@ -1517,7 +1517,7 @@ explain execute f1(to_date('2009-01-02', 'YYYY-MM-DD')); -- should eliminate par
-> Append (cost=0.00..1.00 rows=1 width=40)
-> Seq Scan on fact_1_prt_1 (cost=0.00..1.00 rows=1 width=40)
Filter: dd < '01-02-2009'::date
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
-- start_ignore
......
......@@ -20,7 +20,7 @@ explain select * from bfv_statistics_foo where a is not null and b >= 1;
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..2.05 rows=3 width=8)
-> Seq Scan on bfv_statistics_foo (cost=0.00..2.05 rows=1 width=8)
Filter: a IS NOT NULL AND b >= 1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(4 rows)
create table bfv_statistics_foo2(a int) distributed by (a);
......@@ -47,7 +47,7 @@ explain select a from bfv_statistics_foo2 where a > 1 order by a;
Sort Key: a
-> Seq Scan on bfv_statistics_foo2 (cost=0.00..2.25 rows=5 width=4)
Filter: a > 1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- change stats manually so that MCV and MCF numbers do not match
......@@ -63,7 +63,7 @@ explain select a from bfv_statistics_foo2 where a > 1 order by a;
Sort Key: a
-> Seq Scan on bfv_statistics_foo2 (cost=0.00..2.25 rows=6 width=4)
Filter: a > 1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
--
......@@ -128,7 +128,7 @@ explain select a from bfv_statistics_foo4 where a > 888;
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..4.25 rows=1 width=4)
-> Seq Scan on bfv_statistics_foo4 (cost=0.00..4.25 rows=1 width=4)
Filter: a > 888
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(4 rows)
--
......@@ -394,7 +394,7 @@ EXPLAIN SELECT * FROM test_join_card1 t1, test_join_card2 t2, test_join_card3 t3
-> Seq Scan on test_join_card3 t3 (cost=0.00..115.00 rows=3334 width=8)
-> Hash (cost=227.00..227.00 rows=6667 width=10)
-> Seq Scan on test_join_card1 t1 (cost=0.00..227.00 rows=6667 width=10)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
-- start_ignore
......
......@@ -495,7 +495,7 @@ EXPLAIN SELECT (EXISTS (SELECT UNNEST(X))) AS B FROM A;
SubPlan 1
-> Result (cost=0.00..0.01 rows=1 width=0)
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(6 rows)
DROP TABLE A;
......@@ -614,7 +614,7 @@ explain select * from unlogged_test where c1 = 100;
Gather Motion 1:1 (slice1; segments: 1) (cost=0.00..200.45 rows=1 width=4)
-> Index Scan using unlogged_test_idx on unlogged_test (cost=0.00..200.45 rows=1 width=4)
Index Cond: c1 = 100
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(4 rows)
select * from unlogged_test where c1 = 100;
......
......@@ -70,7 +70,7 @@ EXPLAIN SELECT count(*) FROM bmscantest2 WHERE a = 1 AND b = 1 AND c = 1;
-> Bitmap Index Scan on i_bmtest2_c (cost=0.00..17.60 rows=420 width=0)
Index Cond: (c = 1)
Planning time: 1.441 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
SELECT count(*) FROM bmscantest2 WHERE a = 1 AND b = 1 AND c = 1;
......@@ -101,7 +101,7 @@ EXPLAIN SELECT count(*) FROM bmscantest2 WHERE a = 1 OR b = 1 OR c = 1;
-> Bitmap Index Scan on i_bmtest2_c (cost=0.00..17.99 rows=437 width=0)
Index Cond: (c = 1)
Planning time: 0.468 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
SELECT count(*) FROM bmscantest2 WHERE a = 1 OR b = 1 OR c = 1;
......@@ -143,7 +143,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_ao WHERE a = 1 AND b = 1 AND c = 1;
-> Bitmap Index Scan on i_bmtest_ao_c (cost=0.00..17.79 rows=428 width=0)
Index Cond: (c = 1)
Planning time: 1.009 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
SELECT count(*) FROM bmscantest_ao WHERE a = 1 AND b = 1 AND c = 1;
......@@ -171,7 +171,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_ao WHERE a = 1 AND (b = 1 OR c = 1) AND
-> Bitmap Index Scan on i_bmtest_ao_c (cost=0.00..17.79 rows=428 width=0)
Index Cond: (c = 1)
Planning time: 0.504 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
SELECT count(*) FROM bmscantest_ao WHERE a = 1 AND (b = 1 OR c = 1) AND d = 1;
......@@ -196,7 +196,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_ao WHERE a = 1 OR b = 1 OR c = 1;
-> Bitmap Index Scan on i_bmtest_ao_c (cost=0.00..17.79 rows=428 width=0)
Index Cond: (c = 1)
Planning time: 0.370 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
SELECT count(*) FROM bmscantest_ao WHERE a = 1 OR b = 1 OR c = 1;
......@@ -224,7 +224,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_ao WHERE a = 1 OR (b = 1 AND c = 1) OR d
-> Bitmap Index Scan on i_bmtest_ao_d (cost=0.00..16.99 rows=392 width=0)
Index Cond: (d = 1)
Planning time: 0.520 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
SELECT count(*) FROM bmscantest_ao WHERE a = 1 OR (b = 1 AND c = 1) OR d = 1;
......@@ -260,7 +260,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_aocs WHERE a = 1 AND b = 1 AND c = 1;
-> Bitmap Index Scan on i_bmtest_aocs_c (cost=0.00..17.14 rows=400 width=0)
Index Cond: (c = 1)
Planning time: 1.587 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
SELECT count(*) FROM bmscantest_aocs WHERE a = 1 AND b = 1 AND c = 1;
......@@ -288,7 +288,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_aocs WHERE a = 1 AND (b = 1 OR c = 1) AN
-> Bitmap Index Scan on i_bmtest_aocs_c (cost=0.00..18.28 rows=450 width=0)
Index Cond: (c = 1)
Planning time: 0.495 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
SELECT count(*) FROM bmscantest_aocs WHERE a = 1 AND (b = 1 OR c = 1) AND d = 1;
......@@ -313,7 +313,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_aocs WHERE a = 1 OR b = 1 OR c = 1;
-> Bitmap Index Scan on i_bmtest_aocs_c (cost=0.00..18.28 rows=450 width=0)
Index Cond: (c = 1)
Planning time: 0.366 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
SELECT count(*) FROM bmscantest_aocs WHERE a = 1 OR b = 1 OR c = 1;
......@@ -341,7 +341,7 @@ EXPLAIN SELECT count(*) FROM bmscantest_aocs WHERE a = 1 OR (b = 1 AND c = 1) OR
-> Bitmap Index Scan on i_bmtest_aocs_d (cost=0.00..16.82 rows=385 width=0)
Index Cond: (d = 1)
Planning time: 0.480 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
SELECT count(*) FROM bmscantest_aocs WHERE a = 1 OR (b = 1 AND c = 1) OR d = 1;
......
......@@ -65,7 +65,7 @@ explain select f.id from co_nestloop_idxscan.bar b, co_nestloop_idxscan.foo f wh
-> Bitmap Index Scan on foo_id_idx (cost=0.00..100.36 rows=1 width=0)
Index Cond: f.id = b.id
Settings: enable_hashjoin=off; enable_seqscan=off; optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(10 rows)
select f.id from co_nestloop_idxscan.foo f, co_nestloop_idxscan.bar b where f.id = b.id;
......
......@@ -1543,7 +1543,7 @@ explain (costs off) select * from tt18v;
-> Append
-> Seq Scan on int8_tbl xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-> Seq Scan on int8_tbl xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx_1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
-- check display of ScalarArrayOp with a sub-select
......
......@@ -295,7 +295,7 @@ explain (verbose, costs off)
-> Seq Scan on public.dcomptable
Output: (d1[1].r := (d1[1].r - 1::double precision))[1].i := (d1[1].i + 1::double precision), ctid, gp_segment_id
Filter: (dcomptable.d1[1].i > 0::double precision)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(6 rows)
......
......@@ -295,7 +295,7 @@ explain (verbose, costs off)
-> Seq Scan on public.dcomptable
Output: (d1[1].r := (d1[1].r - 1::double precision))[1].i := (d1[1].i + 1::double precision), ctid, gp_segment_id
Filter: (dcomptable.d1[1].i > 0::double precision)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(6 rows)
......
......@@ -101,7 +101,7 @@ explain select * from t, pt where tid = ptid;
Filter: t.tid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select * from t, pt where tid = ptid;
......@@ -157,7 +157,7 @@ explain select * from t, pt where tid + 1 = ptid;
Filter: t.tid + 1
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select * from t, pt where tid + 1 = ptid;
......@@ -214,7 +214,7 @@ explain select * from t, pt where tid = ptid and t1 = 'hello' || tid;
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.07 rows=1 width=19)
-> Seq Scan on t (cost=0.00..2.04 rows=1 width=19)
Filter: t1 = ('hello'::text || tid::text)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(29 rows)
select * from t, pt where tid = ptid and t1 = 'hello' || tid;
......@@ -270,7 +270,7 @@ explain select * from t, pt where t1 = pt1 and ptid = tid;
Filter: t.tid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select * from t, pt where t1 = pt1 and ptid = tid;
......@@ -314,7 +314,7 @@ explain select * from pt where ptid in (select tid from t where t1 = 'hello' ||
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.07 rows=1 width=4)
-> Seq Scan on t (cost=0.00..2.04 rows=1 width=4)
Filter: (t1 = ('hello'::text || (tid)::text))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(29 rows)
select * from pt where ptid in (select tid from t where t1 = 'hello' || tid);
......@@ -374,7 +374,7 @@ explain select * from pt where exists (select 1 from t where tid = ptid and t1 =
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.07 rows=1 width=4)
-> Seq Scan on t (cost=0.00..2.04 rows=1 width=4)
Filter: (t1 = ('hello'::text || (tid)::text))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(29 rows)
select * from pt where exists (select 1 from t where tid = ptid and t1 = 'hello' || tid);
......@@ -435,7 +435,7 @@ explain select count(*) from t, pt where tid = ptid;
Filter: t.tid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=4)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(30 rows)
select count(*) from t, pt where tid = ptid;
......@@ -482,7 +482,7 @@ explain select *, rank() over (order by ptid,pt1) from t, pt where tid = ptid;
Filter: t.tid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(33 rows)
select *, rank() over (order by ptid,pt1) from t, pt where tid = ptid;
......@@ -570,7 +570,7 @@ explain select * from t, pt where tid = ptid
Filter: t_1.tid + 2
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t t_1 (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(55 rows)
select * from t, pt where tid = ptid
......@@ -683,7 +683,7 @@ explain select count(*) from
Filter: t_1.tid + 2
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t t_1 (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(58 rows)
select count(*) from
......@@ -732,7 +732,7 @@ explain select * from t, pt where tid = ptid;
Filter: t.tid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select * from t, pt where tid = ptid;
......@@ -788,7 +788,7 @@ explain select * from t, pt where tid = ptid and pt1 = 'hello0';
Index Cond: (pt1 = 'hello0'::text)
-> Index Scan using pt_1_prt_6_pt1_idx on pt_1_prt_6 (cost=0.14..200.15 rows=1 width=31)
Index Cond: (pt1 = 'hello0'::text)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(20 rows)
select * from t, pt where tid = ptid and pt1 = 'hello0';
......@@ -820,7 +820,7 @@ explain select * from t, pt where tid = ptid;
-> Index Scan using pt_1_prt_4_ptid_idx on pt_1_prt_4 (cost=0.14..706.21 rows=3 width=31)
-> Index Scan using pt_1_prt_5_ptid_idx on pt_1_prt_5 (cost=0.14..706.21 rows=3 width=31)
-> Index Scan using pt_1_prt_6_ptid_idx on pt_1_prt_6 (cost=0.14..706.21 rows=3 width=31)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
select * from t, pt where tid = ptid;
......@@ -869,7 +869,7 @@ explain select * from t, pt where t1 = pt1;
-> Hash (cost=2.08..2.08 rows=2 width=19)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..2.08 rows=2 width=19)
-> Seq Scan on t (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
select * from t, pt where t1 = pt1;
......@@ -895,7 +895,7 @@ explain select * from t, pt where tid < ptid;
-> Seq Scan on pt_1_prt_4 (cost=0.00..3.09 rows=3 width=31)
-> Seq Scan on pt_1_prt_5 (cost=0.00..3.09 rows=3 width=31)
-> Seq Scan on pt_1_prt_6 (cost=0.00..3.09 rows=3 width=31)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
select * from t, pt where tid < ptid;
......@@ -1025,7 +1025,7 @@ explain select * from t, t1, pt where t1.t2 = t.t2 and t1.tid = ptid;
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..2.06 rows=1 width=19)
Hash Key: t1.t2
-> Seq Scan on t1 (cost=0.00..2.02 rows=1 width=19)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(36 rows)
select * from t, t1, pt where t1.t2 = t.t2 and t1.tid = ptid;
......@@ -1108,7 +1108,7 @@ explain analyze select * from t, pt where tid = ptid;
(slice1) Executor memory: 66K bytes avg x 3 workers, 66K bytes max (seg0).
(slice2) Executor memory: 4406K bytes avg x 3 workers, 4406K bytes max (seg0). Work_mem: 1K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 15.697 ms
(35 rows)
......@@ -1147,7 +1147,7 @@ explain select * from pt, pt1 where pt.ptid = pt1.ptid and pt.pt1 = 'hello0' ord
-> Seq Scan on pt1_1_prt_4 (cost=0.00..3.09 rows=3 width=31)
-> Seq Scan on pt1_1_prt_5 (cost=0.00..3.09 rows=3 width=31)
-> Seq Scan on pt1_1_prt_6 (cost=0.00..3.09 rows=3 width=31)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(29 rows)
select * from pt, pt1 where pt.ptid = pt1.ptid and pt.pt1 = 'hello0' order by pt1.dist;
......@@ -1194,7 +1194,7 @@ explain select count(*) from pt, pt1 where pt.ptid = pt1.ptid and pt.pt1 = 'hell
-> Seq Scan on pt1_1_prt_4 (cost=0.00..3.09 rows=3 width=4)
-> Seq Scan on pt1_1_prt_5 (cost=0.00..3.09 rows=3 width=4)
-> Seq Scan on pt1_1_prt_6 (cost=0.00..3.09 rows=3 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select count(*) from pt, pt1 where pt.ptid = pt1.ptid and pt.pt1 = 'hello0';
......@@ -1243,7 +1243,7 @@ explain select * from t, pt where a = b;
-> Seq Scan on pt_1_prt_3 (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on pt_1_prt_4 (cost=0.00..1.01 rows=1 width=8)
-> Seq Scan on pt_1_prt_5 (cost=0.00..1.01 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(16 rows)
select * from t, pt where a = b;
......@@ -1308,7 +1308,7 @@ explain select * from t, pt where a = b;
-> Partition Selector for pt (dynamic scan id: 1) (cost=0.00..1.02 rows=1 width=4)
Filter: t.a
-> Seq Scan on t (cost=0.00..1.02 rows=1 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(24 rows)
select * from t, pt where a = b;
......@@ -1395,7 +1395,7 @@ explain select * from dim1 inner join fact1 on (dim1.pid=fact1.pid and dim1.code
-> Hash (cost=1.04..1.04 rows=1 width=18)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=18)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=18)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(23 rows)
select * from dim1 inner join fact1 on (dim1.pid=fact1.pid and dim1.code=fact1.code) order by fact1.u;
......@@ -1505,7 +1505,7 @@ explain select * from dim1 inner join fact1 on (dim1.pid=fact1.pid and dim1.code
Filter: dim1.code, dim1.pid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=18)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=18)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(49 rows)
select * from dim1 inner join fact1 on (dim1.pid=fact1.pid and dim1.code=fact1.code) order by fact1.u;
......@@ -1592,7 +1592,7 @@ explain select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) order by fac
-> Hash (cost=1.04..1.04 rows=1 width=18)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=18)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=18)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(23 rows)
select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) order by fact1.u;
......@@ -1752,7 +1752,7 @@ explain select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) order by fac
Filter: dim1.pid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=18)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=18)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(49 rows)
select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) order by fact1.u;
......@@ -1885,7 +1885,7 @@ explain select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) and fact1.co
-> Hash (cost=1.04..1.04 rows=1 width=18)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=18)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=18)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(19 rows)
select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) and fact1.code = 'OH' order by fact1.u;
......@@ -1975,7 +1975,7 @@ explain select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) and fact1.co
Filter: dim1.pid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=18)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=18)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(29 rows)
select * from dim1 inner join fact1 on (dim1.pid=fact1.pid) and fact1.code = 'OH' order by fact1.u;
......@@ -2072,7 +2072,7 @@ explain select fact1.code, count(*) from dim1 inner join fact1 on (dim1.pid=fact
-> Hash (cost=1.04..1.04 rows=1 width=4)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=4)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(33 rows)
select fact1.code, count(*) from dim1 inner join fact1 on (dim1.pid=fact1.pid) group by 1 order by 1;
......@@ -2144,7 +2144,7 @@ explain select fact1.code, count(*) from dim1 inner join fact1 on (dim1.pid=fact
Filter: dim1.pid
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.04 rows=1 width=4)
-> Seq Scan on dim1 (cost=0.00..1.01 rows=1 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(59 rows)
select fact1.code, count(*) from dim1 inner join fact1 on (dim1.pid=fact1.pid) group by 1 order by 1;
......@@ -2209,7 +2209,7 @@ explain select * from dim inner join malp on (dim.i = malp.i);
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..1.03 rows=1 width=8)
Hash Key: dim.i
-> Seq Scan on dim (cost=0.00..1.01 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(20 rows)
set gp_dynamic_partition_pruning = off;
......@@ -2283,7 +2283,7 @@ explain select * from apart as a, b, c where a.t = b.t and a.id = c.id;
-> Hash (cost=3.20..3.20 rows=4 width=6)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..3.20 rows=4 width=6)
-> Seq Scan on b (cost=0.00..3.05 rows=2 width=6)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
select * from apart as a, b, c where a.t = b.t and a.id = c.id;
......@@ -2328,7 +2328,7 @@ explain select * from apart as a, b, c where a.t = b.t and a.id = c.id;
-> Hash (cost=3.20..3.20 rows=4 width=6)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..3.20 rows=4 width=6)
-> Seq Scan on b (cost=0.00..3.05 rows=2 width=6)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(29 rows)
select * from apart as a, b, c where a.t = b.t and a.id = c.id;
......@@ -2397,7 +2397,7 @@ explain select * from (select count(*) over (order by a rows between 1 preceding
-> Sort (cost=1.02..1.02 rows=1 width=8)
Sort Key: jpat_1.a
-> Seq Scan on jpat jpat_1 (cost=0.00..1.01 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(32 rows)
select * from (select count(*) over (order by a rows between 1 preceding and 1 following), a, b from jpat)jpat inner join pat using(b);
......
......@@ -1748,7 +1748,7 @@ explain select * from dim inner join malp on (dim.i = malp.i);
-> Redistribute Motion 3:3 (slice1; segments: 3) (cost=0.00..1.03 rows=1 width=8)
Hash Key: dim.i
-> Seq Scan on dim (cost=0.00..1.01 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(20 rows)
set gp_dynamic_partition_pruning = off;
......
......@@ -57,7 +57,7 @@ explain analyze select d, count(*) from smallt group by d;
(slice1) Executor memory: 166K bytes avg x 3 workers, 166K bytes max (seg0).
(slice2) Executor memory: 138K bytes avg x 3 workers, 138K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 2.162 ms
(16 rows)
......@@ -84,7 +84,7 @@ explain analyze select count(*) from (select i, t, d, count(*) from bigt group b
(slice1) * Executor memory: 3004K bytes avg x 3 workers, 3004K bytes max (seg0). Work_mem: 2361K bytes max, 4738K bytes wanted.
Memory used: 2560kB
Memory wanted: 5237kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 492.921 ms
(15 rows)
......@@ -107,7 +107,7 @@ explain analyze select count(distinct d) from smallt;
(slice0) Executor memory: 322K bytes. Work_mem: 33K bytes max.
(slice1) Executor memory: 46K bytes avg x 3 workers, 46K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1.348 ms
(8 rows)
......@@ -128,7 +128,7 @@ explain analyze select count(distinct d) from bigt;
(slice1) Executor memory: 70K bytes avg x 3 workers, 70K bytes max (seg0).
Memory used: 2560kB
Memory wanted: 23713kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 4936.653 ms
(9 rows)
......@@ -200,7 +200,7 @@ where t1.d = t2.d;
(slice2) Executor memory: 166K bytes avg x 3 workers, 166K bytes max (seg0).
(slice3) Executor memory: 218K bytes avg x 3 workers, 218K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 3.272 ms
(29 rows)
......@@ -249,7 +249,7 @@ where t1.i = t2.i;
(slice0) Executor memory: 386K bytes.
(slice1) Executor memory: 278K bytes avg x 3 workers, 278K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1.614 ms
(17 rows)
......@@ -284,7 +284,7 @@ explain analyze select d, count(*) from smallt group by d limit 5;
(slice1) Executor memory: 166K bytes avg x 3 workers, 166K bytes max (seg0).
(slice2) Executor memory: 170K bytes avg x 3 workers, 170K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 3.057 ms
(17 rows)
......@@ -1307,7 +1307,7 @@ explain analyze select t1.* from smallt as t1, smallt as t2 where t1.i = t2.i;
(slice0) Executor memory: 322K bytes.
(slice1) Executor memory: 4202K bytes avg x 3 workers, 4206K bytes max (seg0). Work_mem: 2K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 7.932 ms
(12 rows)
......@@ -1386,7 +1386,7 @@ where i < (select count(*) from smallt where smallt.i = smallt2.i);
Filter: smallt.i < count(*)
Group Key: smallt.i
-> Seq Scan on smallt (cost=0.00..4.00 rows=34 width=4)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(12 rows)
-- Sort in MergeJoin
......@@ -1619,7 +1619,7 @@ explain analyze select t1.* from smallt as t1, smallt as t2 where t1.i = t2.i an
(slice0) Executor memory: 386K bytes.
(slice1) Executor memory: 120K bytes avg x 3 workers, 142K bytes max (seg0). Work_mem: 33K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1.433 ms
(18 rows)
......@@ -1749,7 +1749,7 @@ explain analyze select t1.* from smallt as t1, smallt as t2 where t1.d = t2.d an
(slice1) Executor memory: 60K bytes avg x 3 workers, 62K bytes max (seg0).
(slice2) Executor memory: 158K bytes avg x 3 workers, 158K bytes max (seg0). Work_mem: 33K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 2.362 ms
(19 rows)
......@@ -1814,7 +1814,7 @@ and smallt.d = '2011-01-04'::date;
(slice0) Executor memory: 437K bytes.
(slice1) Executor memory: 128K bytes avg x 3 workers, 149K bytes max (seg1).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1.672 ms
(13 rows)
......@@ -1834,7 +1834,7 @@ explain analyze select *, exists(select 1 from pg_class where oid = c.oid) as du
* (slice0) Executor memory: 1118K bytes. Work_mem: 96K bytes max, 64K bytes wanted.
Memory used: 128000kB
Memory wanted: 364kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 21.231 ms
(14 rows)
......@@ -1889,7 +1889,7 @@ and smallt.d = '2011-01-04'::date;
(slice0) Executor memory: 437K bytes.
(slice1) Executor memory: 480K bytes avg x 3 workers, 678K bytes max (seg1). Work_mem: 9K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1.456 ms
(17 rows)
......
......@@ -1876,7 +1876,7 @@ explain analyze select *, exists(select 1 from pg_class where oid = c.oid) as du
Heap Fetches: 1252
(slice0) Executor memory: 382K bytes.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1.681 ms
(13 rows)
......
......@@ -110,7 +110,7 @@ explain (costs off)
-> Index Scan using ec0_pkey on ec0
Index Cond: (ff = 42::bigint)
Filter: (f1 = 42::bigint)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
explain (costs off)
......@@ -121,7 +121,7 @@ explain (costs off)
-> Index Scan using ec0_pkey on ec0
Index Cond: (ff = '42'::int8alias1)
Filter: (f1 = '42'::int8alias1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
explain (costs off)
......@@ -132,7 +132,7 @@ explain (costs off)
-> Index Scan using ec1_pkey on ec1
Index Cond: (ff = '42'::int8alias1)
Filter: (f1 = '42'::int8alias1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
explain (costs off)
......@@ -142,7 +142,7 @@ explain (costs off)
Gather Motion 3:1 (slice1; segments: 3)
-> Seq Scan on ec1
Filter: ((ff = f1) AND (f1 = '42'::int8alias2))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(4 rows)
explain (costs off)
......@@ -157,7 +157,7 @@ explain (costs off)
-> Broadcast Motion 1:3 (slice1; segments: 1)
-> Index Scan using ec1_pkey on ec1
Index Cond: ((ff = 42::bigint) AND (ff = 42::bigint))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off)
......@@ -172,7 +172,7 @@ explain (costs off)
-> Materialize
-> Seq Scan on ec2
Filter: (x1 = '42'::int8alias1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off)
......@@ -188,7 +188,7 @@ explain (costs off)
-> Materialize
-> Seq Scan on ec2
Filter: (42::bigint = x1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
explain (costs off)
......@@ -203,7 +203,7 @@ explain (costs off)
-> Materialize
-> Seq Scan on ec2
Filter: (x1 = '42'::int8alias1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off)
......@@ -217,7 +217,7 @@ explain (costs off)
Filter: (x1 = '42'::int8alias2)
-> Index Scan using ec1_pkey on ec1
Index Cond: (ff = ec2.x1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
create index ec1_expr1 on ec1((ff + 1));
......@@ -248,7 +248,7 @@ explain (costs off)
-> Broadcast Motion 1:3 (slice1; segments: 1)
-> Index Scan using ec1_pkey on ec1
Index Cond: (ff = 42::bigint)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
explain (costs off)
......@@ -279,7 +279,7 @@ explain (costs off)
-> Index Scan using ec1_pkey on ec1
Index Cond: ((ff = 42::bigint) AND (ff = 42::bigint))
Filter: (ff = f1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(18 rows)
explain (costs off)
......@@ -325,7 +325,7 @@ explain (costs off)
-> Seq Scan on ec1 ec1_5
-> Seq Scan on ec1 ec1_6
-> Seq Scan on ec1 ec1_4
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(27 rows)
-- let's try that as a mergejoin
......@@ -374,7 +374,7 @@ explain (costs off)
-> Seq Scan on ec1 ec1_5
-> Seq Scan on ec1 ec1_6
-> Seq Scan on ec1 ec1_4
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(27 rows)
-- check partially indexed scan
......@@ -405,7 +405,7 @@ explain (costs off)
-> Broadcast Motion 1:3 (slice1; segments: 1)
-> Index Scan using ec1_pkey on ec1
Index Cond: (ff = 42::bigint)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
-- let's try that as a mergejoin
......@@ -435,6 +435,6 @@ explain (costs off)
-> Broadcast Motion 1:3 (slice1; segments: 1)
-> Index Scan using ec1_pkey on ec1
Index Cond: (ff = 42::bigint)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
......@@ -121,7 +121,7 @@ explain (costs off)
-> Index Scan using ec0_pkey on ec0
Index Cond: (ff = '42'::int8alias1)
Filter: (f1 = '42'::int8alias1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
explain (costs off)
......@@ -171,7 +171,7 @@ explain (costs off)
-> Materialize
-> Seq Scan on ec2
Filter: (x1 = '42'::int8alias1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off)
......
......@@ -43,7 +43,7 @@ EXPLAIN SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.apple_id LEFT
-> Seq Scan on boxes (cost=0.00..879.00 rows=25967 width=12)
-> Hash (cost=596.00..596.00 rows=16534 width=36)
-> Seq Scan on box_locations (cost=0.00..596.00 rows=16534 width=36)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
-- explain_processing_on
......@@ -72,7 +72,7 @@ EXPLAIN (ANALYZE) SELECT * from boxes LEFT JOIN apples ON apples.id = boxes.appl
(slice2) Executor memory: 2128K bytes avg x 3 workers, 2128K bytes max (seg0).
(slice3) Executor memory: 1104K bytes avg x 3 workers, 1104K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Execution time: 29.929 ms
(22 rows)
......@@ -232,7 +232,7 @@ QUERY PLAN
Plan Rows: 49600
Plan Width: 36
Settings:
Optimizer: "legacy query optimizer"
Optimizer: "Postgres query optimizer"
(1 row)
--- Check Explain Analyze YAML output that include the slices information
-- explain_processing_off
......@@ -416,7 +416,7 @@ QUERY PLAN
Statement statistics:
Memory used: 128000
Settings:
Optimizer: "legacy query optimizer"
Optimizer: "Postgres query optimizer"
Execution Time: 8.490
(1 row)
-- explain_processing_on
......@@ -442,7 +442,7 @@ QUERY PLAN
"Alias": "generate_series"
},
"Settings": {
"Optimizer": "legacy query optimizer"
"Optimizer": "Postgres query optimizer"
}
}
]
......@@ -457,7 +457,7 @@ QUERY PLAN
<Alias>generate_series</Alias>
</Plan>
<Settings>
<Optimizer>legacy query optimizer</Optimizer>
<Optimizer>Postgres query optimizer</Optimizer>
</Settings>
</Query>
</explain>
......
......@@ -319,7 +319,7 @@ explain select * from srf_testtab, test_srf();
-> Seq Scan on srf_testtab (cost=0.00..1.01 rows=1 width=6)
-> Function Scan on test_srf (cost=0.25..10.25 rows=334 width=32)
Planning time: 0.220 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
explain select * from srf_testtab, test_srf() where test_srf = srf_testtab.t;
......@@ -332,7 +332,7 @@ explain select * from srf_testtab, test_srf() where test_srf = srf_testtab.t;
-> Hash (cost=1.01..1.01 rows=1 width=6)
-> Seq Scan on srf_testtab (cost=0.00..1.01 rows=1 width=6)
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
-- Test ALTER FUNCTION, and that \df displays the EXECUTE ON correctly
......
......@@ -32,7 +32,7 @@ explain (costs off) select count(distinct d) from dqa_t1;
-> HashAggregate
Group Key: dqa_t1.d
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
select count(distinct d) from dqa_t1 group by i;
......@@ -65,7 +65,7 @@ explain (costs off) select count(distinct d) from dqa_t1 group by i;
-> HashAggregate
Group Key: dqa_t1.i, dqa_t1.d
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
select count(distinct d), count(distinct dt) from dqa_t1;
......@@ -94,7 +94,7 @@ explain (costs off) select count(distinct d), count(distinct dt) from dqa_t1;
-> HashAggregate
Group Key: share0_ref2.dt
-> Shared Scan (share slice:id 2:0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(18 rows)
select count(distinct d), count(distinct c), count(distinct dt) from dqa_t1;
......@@ -133,7 +133,7 @@ explain (costs off) select count(distinct d), count(distinct c), count(distinct
-> HashAggregate
Group Key: share0_ref3.dt
-> Shared Scan (share slice:id 4:0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select count(distinct d), count(distinct dt) from dqa_t1 group by c;
......@@ -178,7 +178,7 @@ explain (costs off) select count(distinct d), count(distinct dt) from dqa_t1 gro
-> Shared Scan (share slice:id 2:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(25 rows)
select count(distinct d), count(distinct dt) from dqa_t1 group by d;
......@@ -232,7 +232,7 @@ explain (costs off) select count(distinct d), count(distinct dt) from dqa_t1 gro
-> Shared Scan (share slice:id 1:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(21 rows)
select count(distinct dqa_t1.d) from dqa_t1, dqa_t2 where dqa_t1.d = dqa_t2.d;
......@@ -253,7 +253,7 @@ explain (costs off) select count(distinct dqa_t1.d) from dqa_t1, dqa_t2 where dq
-> Seq Scan on dqa_t1
-> Hash
-> Seq Scan on dqa_t2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select count(distinct dqa_t1.d) from dqa_t1, dqa_t2 where dqa_t1.d = dqa_t2.d group by dqa_t2.dt;
......@@ -334,7 +334,7 @@ explain (costs off) select count(distinct dqa_t1.d) from dqa_t1, dqa_t2 where dq
-> Seq Scan on dqa_t1
-> Hash
-> Seq Scan on dqa_t2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
-- Distinct keys are not distribution keys
......@@ -356,7 +356,7 @@ explain (costs off) select count(distinct c) from dqa_t1;
-> HashAggregate
Group Key: dqa_t1.c
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select count(distinct c) from dqa_t1 group by dt;
......@@ -411,7 +411,7 @@ explain (costs off) select count(distinct c) from dqa_t1 group by dt;
-> HashAggregate
Group Key: dqa_t1.dt, dqa_t1.c
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
select count(distinct c) from dqa_t1 group by d;
......@@ -453,7 +453,7 @@ explain (costs off) select count(distinct c) from dqa_t1 group by d;
-> HashAggregate
Group Key: dqa_t1.d, dqa_t1.c
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select count(distinct c), count(distinct dt) from dqa_t1;
......@@ -486,7 +486,7 @@ explain (costs off) select count(distinct c), count(distinct dt) from dqa_t1;
-> HashAggregate
Group Key: share0_ref2.dt
-> Shared Scan (share slice:id 3:0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(22 rows)
select count(distinct c), count(distinct dt), i from dqa_t1 group by i;
......@@ -533,7 +533,7 @@ explain (costs off) select count(distinct c), count(distinct dt), i from dqa_t1
-> Shared Scan (share slice:id 2:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(25 rows)
select count(distinct i), count(distinct c), d from dqa_t1 group by d;
......@@ -587,7 +587,7 @@ explain (costs off) select count(distinct i), count(distinct c), d from dqa_t1 g
-> Shared Scan (share slice:id 1:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(21 rows)
select count(distinct dqa_t1.dt) from dqa_t1, dqa_t2 where dqa_t1.c = dqa_t2.c;
......@@ -613,7 +613,7 @@ explain (costs off) select count(distinct dqa_t1.dt) from dqa_t1, dqa_t2 where d
-> Seq Scan on dqa_t2
-> Hash
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
select count(distinct dqa_t1.dt) from dqa_t1, dqa_t2 where dqa_t1.c = dqa_t2.c group by dqa_t2.dt;
......@@ -698,7 +698,7 @@ explain (costs off) select count(distinct dqa_t1.dt) from dqa_t1, dqa_t2 where d
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: dqa_t2.c
-> Seq Scan on dqa_t2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(19 rows)
-- MPP-19037
......
......@@ -95,7 +95,7 @@ explain (costs off) select count(distinct d), count(distinct dt) from dqa_t1;
-> HashAggregate
Group Key: share0_ref2.dt
-> Shared Scan (share slice:id 2:0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(18 rows)
select count(distinct d), count(distinct c), count(distinct dt) from dqa_t1;
......@@ -134,7 +134,7 @@ explain (costs off) select count(distinct d), count(distinct c), count(distinct
-> HashAggregate
Group Key: share0_ref3.dt
-> Shared Scan (share slice:id 4:0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(28 rows)
select count(distinct d), count(distinct dt) from dqa_t1 group by c;
......@@ -179,7 +179,7 @@ explain (costs off) select count(distinct d), count(distinct dt) from dqa_t1 gro
-> Shared Scan (share slice:id 2:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(25 rows)
select count(distinct d), count(distinct dt) from dqa_t1 group by d;
......@@ -233,7 +233,7 @@ explain (costs off) select count(distinct d), count(distinct dt) from dqa_t1 gro
-> Shared Scan (share slice:id 1:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(21 rows)
select count(distinct dqa_t1.d) from dqa_t1, dqa_t2 where dqa_t1.d = dqa_t2.d;
......@@ -502,7 +502,7 @@ explain (costs off) select count(distinct c), count(distinct dt) from dqa_t1;
-> HashAggregate
Group Key: share0_ref2.dt
-> Shared Scan (share slice:id 3:0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(22 rows)
select count(distinct c), count(distinct dt), i from dqa_t1 group by i;
......@@ -549,7 +549,7 @@ explain (costs off) select count(distinct c), count(distinct dt), i from dqa_t1
-> Shared Scan (share slice:id 2:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(25 rows)
select count(distinct i), count(distinct c), d from dqa_t1 group by d;
......@@ -603,7 +603,7 @@ explain (costs off) select count(distinct i), count(distinct c), d from dqa_t1 g
-> Shared Scan (share slice:id 1:0)
-> Materialize
-> Seq Scan on dqa_t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(21 rows)
select count(distinct dqa_t1.dt) from dqa_t1, dqa_t2 where dqa_t1.c = dqa_t2.c;
......
......@@ -93,7 +93,7 @@ WHERE mpp22263.unique1 = v.i and mpp22263.stringu1 = v.j;
-> Seq Scan on mpp22263 (cost=0.00..219.00 rows=3967 width=244)
-> Hash (cost=0.03..0.03 rows=1 width=36)
-> Values Scan on "*VALUES*" (cost=0.00..0.03 rows=1 width=36)
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(7 rows)
-- atmsort.pm masks out differences in the Filter line, so just memorizing
......@@ -145,7 +145,7 @@ explain (costs off) select count(*) over (partition by g) from generate_series(1
-> Sort
Sort Key: g
-> Function Scan on generate_series g
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
--
......@@ -159,33 +159,33 @@ explain (costs off) select count(*) over (partition by g) from generate_series(1
CREATE EXTERNAL WEB TABLE dummy_ext_tab (x text) EXECUTE 'echo foo' FORMAT 'text';
-- External Table Scan
explain (format json, costs off) SELECT * FROM dummy_ext_tab;
QUERY PLAN
---------------------------------------------
[ +
{ +
"Plan": { +
"Node Type": "Gather Motion", +
"Senders": 3, +
"Receivers": 1, +
"Slice": 1, +
"Segments": 3, +
"Gang Type": "primary reader", +
"Plans": [ +
{ +
"Node Type": "External Scan", +
"Parent Relationship": "Outer", +
"Slice": 1, +
"Segments": 3, +
"Gang Type": "primary reader", +
"Relation Name": "dummy_ext_tab",+
"Alias": "dummy_ext_tab" +
} +
] +
}, +
"Settings": { +
"Optimizer": "legacy query optimizer"+
} +
} +
QUERY PLAN
-----------------------------------------------
[ +
{ +
"Plan": { +
"Node Type": "Gather Motion", +
"Senders": 3, +
"Receivers": 1, +
"Slice": 1, +
"Segments": 3, +
"Gang Type": "primary reader", +
"Plans": [ +
{ +
"Node Type": "External Scan", +
"Parent Relationship": "Outer", +
"Slice": 1, +
"Segments": 3, +
"Gang Type": "primary reader", +
"Relation Name": "dummy_ext_tab", +
"Alias": "dummy_ext_tab" +
} +
] +
}, +
"Settings": { +
"Optimizer": "Postgres query optimizer"+
} +
} +
]
(1 row)
......@@ -194,25 +194,25 @@ CREATE TEMP TABLE dummy_aotab (x int4) WITH (appendonly=true);
NOTICE: Table doesn't have 'DISTRIBUTED BY' clause -- Using column named 'x' as the Greenplum Database data distribution key for this table.
HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sure column(s) chosen are the optimal data distribution key to minimize skew.
explain (format yaml, costs off) SELECT * FROM dummy_aotab;
QUERY PLAN
-----------------------------------------
- Plan: +
Node Type: "Gather Motion" +
Senders: 3 +
Receivers: 1 +
Slice: 1 +
Segments: 3 +
Gang Type: "primary reader" +
Plans: +
- Node Type: "Seq Scan" +
Parent Relationship: "Outer" +
Slice: 1 +
Segments: 3 +
Gang Type: "primary reader" +
Relation Name: "dummy_aotab" +
Alias: "dummy_aotab" +
Settings: +
Optimizer: "legacy query optimizer"
QUERY PLAN
-------------------------------------------
- Plan: +
Node Type: "Gather Motion" +
Senders: 3 +
Receivers: 1 +
Slice: 1 +
Segments: 3 +
Gang Type: "primary reader" +
Plans: +
- Node Type: "Seq Scan" +
Parent Relationship: "Outer" +
Slice: 1 +
Segments: 3 +
Gang Type: "primary reader" +
Relation Name: "dummy_aotab" +
Alias: "dummy_aotab" +
Settings: +
Optimizer: "Postgres query optimizer"
(1 row)
-- DML node (with ORCA)
......@@ -240,7 +240,7 @@ explain (format xml, costs off) insert into dummy_aotab values (1);
</Plans> +
</Plan> +
<Settings> +
<Optimizer>legacy query optimizer</Optimizer> +
<Optimizer>Postgres query optimizer</Optimizer> +
</Settings> +
</Query> +
</explain>
......@@ -274,7 +274,7 @@ explain SELECT * from information_schema.key_column_usage;
-> Hash (cost=49.33..49.33 rows=1111 width=70)
-> Seq Scan on pg_attribute a (cost=0.00..49.33 rows=3333 width=70)
Filter: (NOT attisdropped)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(25 rows)
-- github issue 5794.
......@@ -288,7 +288,7 @@ explain analyze SELECT * FROM explaintest;
(slice0) Executor memory: 322K bytes.
(slice1) Executor memory: 50K bytes avg x 3 workers, 50K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 2.600 ms
(8 rows)
......
......@@ -305,7 +305,7 @@ explain SELECT * from information_schema.key_column_usage;
-> Hash (cost=49.33..49.33 rows=1111 width=70)
-> Seq Scan on pg_attribute a (cost=0.00..49.33 rows=3333 width=70)
Filter: (NOT attisdropped)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(25 rows)
-- github issue 5794.
......
......@@ -165,7 +165,7 @@ explain analyze select a.* from gpd1 as a, gpd1 as b where b.c1 in (select max(c
(slice4) Executor memory: 66K bytes (seg2).
(slice5) Executor memory: 1103K bytes avg x 3 workers, 1114K bytes max (seg2). Work_mem: 1K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 4571.552 ms
(27 rows)
......@@ -189,7 +189,7 @@ explain select a.* from gpd1 as a, gpd1 as b where b.c1 in (select max(c1) from
-> Gather Motion 3:1 (slice3; segments: 3) (cost=1.01..1.07 rows=1 width=32)
-> Aggregate (cost=1.01..1.02 rows=1 width=32)
-> Seq Scan on gpd1 (cost=0.00..1.01 rows=1 width=2)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(18 rows)
select a.* from gpd1 as a, gpd1 as b where b.c1 in (select max(c1) from gpd1);
......@@ -236,7 +236,7 @@ explain select a.* from gpd1 as a, gpd1 as b where b.c1 in (select max(c1) from
-> Gather Motion 3:1 (slice3; segments: 3) (cost=1.01..1.43 rows=1 width=32)
-> Aggregate (cost=1.01..1.02 rows=1 width=32)
-> Seq Scan on gpd1 (cost=0.00..1.01 rows=1 width=2)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(18 rows)
select a.* from gpd1 as a, gpd1 as b where b.c1 in (select max(c1) from gpd1);
......@@ -288,7 +288,7 @@ explain analyze select a.* from gpd1 as a, gpd1 as b where b.c1 in (select max(c
(slice4) Executor memory: 65K bytes (seg2).
(slice5) Executor memory: 1103K bytes avg x 3 workers, 1114K bytes max (seg2). Work_mem: 1K bytes max.
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Total runtime: 1507.339 ms
(27 rows)
......
......@@ -652,7 +652,7 @@ explain (costs off) select even.i from even left outer join odd on (even.i = odd
-> Seq Scan on even
-> Hash
-> Seq Scan on odd
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
-- But this does.
......@@ -671,7 +671,7 @@ explain (costs off) select even.i from even right outer join odd on (even.i = od
-> Seq Scan on odd
-> Hash
-> Seq Scan on even
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
-- Check that we can track the distribution through multiple FULL OUTER JOINs.
......@@ -692,7 +692,7 @@ explain (costs off) select * from a full join b on (a.i=b.i) full join c on (b.i
-> Seq Scan on b
-> Hash
-> Seq Scan on c
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
select * from a full join b on (a.i=b.i) full join c on (b.i=c.i);
......
......@@ -132,7 +132,7 @@ explain (costs off) select * from legacy_int a inner join legacy_int b on a.id =
-> Seq Scan on legacy_int a
-> Hash
-> Seq Scan on legacy_int b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select * from legacy_int a inner join legacy_int b on a.id = b.id;
......@@ -156,7 +156,7 @@ explain (costs off) select * from legacy_int a inner join modern_int b on a.id =
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: b.id
-> Seq Scan on modern_int b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from legacy_int a inner join modern_int b on a.id = b.id;
......@@ -176,7 +176,7 @@ explain (costs off) select * from modern_int a inner join modern_int b on a.id =
-> Seq Scan on modern_int a
-> Hash
-> Seq Scan on modern_int b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select * from modern_int a inner join modern_int b on a.id = b.id;
......@@ -202,7 +202,7 @@ explain (costs off) select * from legacy_int a inner join modern_text b on a.id:
-> Seq Scan on legacy_int a
-> Hash
-> Seq Scan on modern_text b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from legacy_int a inner join modern_text b on a.id::text = b.t;
......@@ -224,7 +224,7 @@ explain (costs off) select * from legacy_domain_over_int a inner join legacy_dom
-> Seq Scan on legacy_domain_over_int a
-> Hash
-> Seq Scan on legacy_domain_over_int b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
explain (costs off) select * from legacy_int a inner join legacy_domain_over_int b on a.id = b.id;
......@@ -236,7 +236,7 @@ explain (costs off) select * from legacy_int a inner join legacy_domain_over_int
-> Seq Scan on legacy_int a
-> Hash
-> Seq Scan on legacy_domain_over_int b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
explain (costs off) select * from modern_int a inner join legacy_domain_over_int b on a.id = b.id;
......@@ -250,7 +250,7 @@ explain (costs off) select * from modern_int a inner join legacy_domain_over_int
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: a.id
-> Seq Scan on modern_int a
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
create type colors as enum ('red', 'green', 'blue');
......@@ -265,7 +265,7 @@ explain (costs off) select * from legacy_enum a inner join legacy_enum b on a.co
-> Seq Scan on legacy_enum a
-> Hash
-> Seq Scan on legacy_enum b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select * from legacy_enum a inner join legacy_enum b on a.color = b.color;
......
......@@ -156,7 +156,7 @@ explain (costs off) select * from legacy_int a inner join modern_int b on a.id =
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: b.id
-> Seq Scan on modern_int b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from legacy_int a inner join modern_int b on a.id = b.id;
......@@ -202,7 +202,7 @@ explain (costs off) select * from legacy_int a inner join modern_text b on a.id:
-> Seq Scan on legacy_int a
-> Hash
-> Seq Scan on modern_text b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from legacy_int a inner join modern_text b on a.id::text = b.t;
......@@ -250,7 +250,7 @@ explain (costs off) select * from modern_int a inner join legacy_domain_over_int
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: a.id
-> Seq Scan on modern_int a
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
create type colors as enum ('red', 'green', 'blue');
......
......@@ -66,7 +66,7 @@ EXPLAIN (COSTS OFF) SELECT a, b FROM abstab_a, abstab_b WHERE a |=| b;
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: abstab_b.b
-> Seq Scan on abstab_b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
SELECT a, b FROM abstab_a, abstab_b WHERE a |=| b;
......@@ -97,7 +97,7 @@ EXPLAIN (COSTS OFF) SELECT a, b FROM abstab_a, abstab_b WHERE a |=| b;
-> Redistribute Motion 3:3 (slice1; segments: 3)
Hash Key: abstab_b.b
-> Seq Scan on abstab_b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
SELECT a, b FROM abstab_a, abstab_b WHERE a |=| b;
......@@ -123,7 +123,7 @@ EXPLAIN (COSTS OFF) SELECT a, b FROM abstab_a, abstab_b WHERE a |=| b;
-> Seq Scan on abstab_a
-> Hash
-> Seq Scan on abstab_b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
SELECT a, b FROM abstab_a, abstab_b WHERE a |=| b;
......@@ -152,7 +152,7 @@ EXPLAIN (COSTS OFF) SELECT a, b FROM abstab_a, abstab_b WHERE a = b;
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: abstab_a.a
-> Seq Scan on abstab_a
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
SELECT a, b FROM abstab_a, abstab_b WHERE a = b;
......
......@@ -2412,7 +2412,7 @@ from orca.bar1 inner join orca.bar2 on (bar1.x2 = bar2.x2) order by bar1.x1;
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..3.20 rows=1 width=0)
-> Seq Scan on foo (cost=0.00..3.20 rows=1 width=0)
Settings: optimizer=off; optimizer_segments=3
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(23 rows)
select case when bar1.x2 = bar2.x2 then coalesce((select 1 from orca.foo where bar1.x2 = bar2.x2 and bar1.x2 = random() and foo.x2 = bar2.x2),0) else 1 end as col1, bar1.x1
......@@ -3492,7 +3492,7 @@ explain select * from orca.r, orca.s where r.a is not distinct from s.c;
-> Materialize (cost=0.00..4.30 rows=20 width=8)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..4.00 rows=20 width=8)
-> Seq Scan on r (cost=0.00..3.20 rows=7 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
-- explain Hash Join with equality join condition
......@@ -3507,7 +3507,7 @@ explain select * from orca.r, orca.s where r.a = s.c;
-> Hash (cost=3.20..3.20 rows=7 width=8)
-> Seq Scan on r (cost=0.00..3.20 rows=7 width=8)
Settings: optimizer=off; optimizer_segments=3
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
-- sort
......@@ -8171,7 +8171,7 @@ explain select * from orca.t order by 1,2;
-> Seq Scan on t_1_prt_part201206 (cost=0.00..364.00 rows=8800 width=94)
-> Seq Scan on t_1_prt_part201207 (cost=0.00..364.00 rows=8800 width=94)
-> Seq Scan on t_1_prt_part201208 (cost=0.00..364.00 rows=8800 width=94)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(12 rows)
select tag2, tag1 from orca.t order by 1, 2;;
......@@ -8265,7 +8265,7 @@ explain select * from orca.t_date where user_id=9;
Filter: user_id = 9::numeric
-> Seq Scan on t_date_1_prt_part201208 (cost=0.00..1.01 rows=1 width=21)
Filter: user_id = 9::numeric
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
select * from orca.t_date where user_id=9;
......@@ -8317,7 +8317,7 @@ explain select * from orca.t_text where user_id=9;
Filter: user_id = 9::numeric
-> Seq Scan on t_text_1_prt_partugly (cost=0.00..2.06 rows=1 width=21)
Filter: user_id = 9::numeric
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from orca.t_text where user_id=9;
......@@ -8376,7 +8376,7 @@ explain select * from orca.t_employee where user_id = 2;
Filter: user_id = 2::numeric
-> Seq Scan on t_employee_1_prt_part2 (cost=0.00..1.04 rows=1 width=47)
Filter: user_id = 2::numeric
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select * from orca.t_employee where user_id = 2;
......@@ -8423,7 +8423,7 @@ explain select * from orca.t_ceeval_ints where user_id=4;
Filter: user_id = 4::numeric
-> Seq Scan on t_ceeval_ints_1_prt_part103 (cost=0.00..1.01 rows=1 width=21)
Filter: user_id = 4::numeric
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from orca.t_ceeval_ints where user_id=4;
......@@ -9545,7 +9545,7 @@ where c.cid = s.cid and s.date_sk = d.date_sk and
-> Seq Scan on sales s (cost=0.00..938.00 rows=28 width=40)
Filter: ((lower(type) = 't1'::text) OR (upper(type) = 'T2'::text))
Planning time: 2.896 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(19 rows)
reset optimizer_segments;
......@@ -9565,7 +9565,7 @@ explain select * from orca.bm_test where i=2 and t='2';
-> Seq Scan on bm_test (cost=0.00..4.50 rows=2 width=6)
Filter: i = 2 AND t = '2'::text
Settings: optimizer=off; optimizer_cte_inlining_bound=1000
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
select * from orca.bm_test where i=2 and t='2';
......@@ -9627,7 +9627,7 @@ explain select * from orca.bm_dyn_test where i=2 and t='2';
Filter: i = 2 AND t = '2'::text
-> Seq Scan on bm_dyn_test_1_prt_part5 (cost=0.00..1.01 rows=1 width=10)
Filter: i = 2 AND t = '2'::text
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
select * from orca.bm_dyn_test where i=2 and t='2';
......@@ -9687,7 +9687,7 @@ explain select * from orca.bm_dyn_test_onepart where i=2 and t='2';
Filter: i = 2 AND t = '2'::text
-> Seq Scan on bm_dyn_test_onepart_1_prt_part5 (cost=0.00..1.01 rows=1 width=10)
Filter: i = 2 AND t = '2'::text
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
select * from orca.bm_dyn_test_onepart where i=2 and t='2';
......@@ -10069,7 +10069,7 @@ ORDER BY 1 asc ;
-> Hash (cost=324.00..324.00 rows=7467 width=108)
-> Seq Scan on my_tt_agg_opt tt (cost=0.00..324.00 rows=7467 width=108)
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_segments=3
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(22 rows)
reset optimizer_segments;
......@@ -10152,7 +10152,7 @@ where ordernum between 10 and 20;
-> Seq Scan on idxscan_inner i (cost=0.00..2.04 rows=1 width=9)
Filter: ordernum >= 10 AND ordernum <= 20
Settings: optimizer=off; optimizer_cte_inlining_bound=1000
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(11 rows)
select id, comment from idxscan_outer as o join idxscan_inner as i on o.id = i.productid
......@@ -10205,7 +10205,7 @@ explain select * from orca.index_test where a = 5;
-> Seq Scan on index_test (cost=0.00..4.25 rows=1 width=20)
Filter: a = 5
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
-- force_explain
......@@ -10216,7 +10216,7 @@ explain select * from orca.index_test where c = 5;
-> Seq Scan on index_test (cost=0.00..4.25 rows=1 width=20)
Filter: c = 5
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
-- force_explain
......@@ -10227,7 +10227,7 @@ explain select * from orca.index_test where a = 5 and c = 5;
-> Seq Scan on index_test (cost=0.00..4.50 rows=1 width=20)
Filter: a = 5 AND c = 5
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
-- renaming columns
......@@ -10319,7 +10319,7 @@ EXPLAIN SELECT * FROM btree_test WHERE a in (1, 47);
-> Seq Scan on btree_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = ANY ('{1,47}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM btree_test WHERE a in ('2', 47);
......@@ -10329,7 +10329,7 @@ EXPLAIN SELECT * FROM btree_test WHERE a in ('2', 47);
-> Seq Scan on btree_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = ANY ('{2,47}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM btree_test WHERE a in ('1', '2');
......@@ -10339,7 +10339,7 @@ EXPLAIN SELECT * FROM btree_test WHERE a in ('1', '2');
-> Seq Scan on btree_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = ANY ('{1,2}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM btree_test WHERE a in ('1', '2', 47);
......@@ -10349,7 +10349,7 @@ EXPLAIN SELECT * FROM btree_test WHERE a in ('1', '2', 47);
-> Seq Scan on btree_test (cost=0.00..4.38 rows=1 width=4)
Filter: a = ANY ('{1,2,47}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
-- Test Bitmap index scan with in list
......@@ -10362,7 +10362,7 @@ EXPLAIN SELECT * FROM bitmap_test WHERE a in (1);
-> Seq Scan on bitmap_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = 1
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM bitmap_test WHERE a in (1, 47);
......@@ -10372,7 +10372,7 @@ EXPLAIN SELECT * FROM bitmap_test WHERE a in (1, 47);
-> Seq Scan on bitmap_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = ANY ('{1,47}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM bitmap_test WHERE a in ('2', 47);
......@@ -10382,7 +10382,7 @@ EXPLAIN SELECT * FROM bitmap_test WHERE a in ('2', 47);
-> Seq Scan on bitmap_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = ANY ('{2,47}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM bitmap_test WHERE a in ('1', '2');
......@@ -10392,7 +10392,7 @@ EXPLAIN SELECT * FROM bitmap_test WHERE a in ('1', '2');
-> Seq Scan on bitmap_test (cost=0.00..4.25 rows=1 width=4)
Filter: a = ANY ('{1,2}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM bitmap_test WHERE a in ('1', '2', 47);
......@@ -10402,7 +10402,7 @@ EXPLAIN SELECT * FROM bitmap_test WHERE a in ('1', '2', 47);
-> Seq Scan on bitmap_test (cost=0.00..4.38 rows=1 width=4)
Filter: a = ANY ('{1,2,47}'::integer[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
-- Test Logging for unsupported features in ORCA
......@@ -10450,7 +10450,7 @@ explain select count(*) from foo group by cube(a,b);
-> Sort (cost=8552.10..8767.35 rows=28700 width=8)
Sort Key: a, b
-> Shared Scan (share slice:id 2:0) (cost=1391.50..1494.60 rows=28700 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(31 rows)
reset client_min_messages;
......@@ -10554,7 +10554,7 @@ explain select * from foo where b in ('1', '2');
-> Seq Scan on foo (cost=0.00..667.50 rows=31 width=42)
Filter: b::text = ANY ('{1,2}'::text[])
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
set optimizer_enable_ctas = off;
......@@ -10594,7 +10594,7 @@ explain (costs off) select count(*), t2.c from input_tab1 t1 left join input_tab
-> Seq Scan on input_tab2 t2
-> Hash
-> Seq Scan on input_tab1 t1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
select count(*), t2.c from input_tab1 t1 left join input_tab2 t2 on t1.a = t2.c group by t2.c;
......@@ -10651,7 +10651,7 @@ FROM (SELECT *
-> Seq Scan on tab_2 (cost=0.00..1.01 rows=1 width=7)
-> Subquery Scan on "*SELECT* 2" (cost=0.00..1.02 rows=1 width=8)
-> Seq Scan on tab_3 (cost=0.00..1.01 rows=1 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(17 rows)
SELECT Count(*)
......@@ -10870,7 +10870,7 @@ EXPLAIN SELECT a FROM csq_cast_param_outer WHERE b in (SELECT CASE WHEN a > 1 TH
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.10 rows=2 width=4)
-> Seq Scan on csq_cast_param_inner (cost=0.00..1.02 rows=1 width=4)
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(9 rows)
SELECT a FROM csq_cast_param_outer WHERE b in (SELECT CASE WHEN a > 1 THEN d ELSE '42' END FROM csq_cast_param_inner);
......@@ -10894,7 +10894,7 @@ EXPLAIN SELECT a FROM csq_cast_param_outer WHERE b in (SELECT CASE WHEN a > 1 TH
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..1.10 rows=2 width=4)
-> Seq Scan on csq_cast_param_inner (cost=0.00..1.02 rows=1 width=4)
Settings: optimizer=off; optimizer_cte_inlining_bound=1000; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(9 rows)
SELECT a FROM csq_cast_param_outer WHERE b in (SELECT CASE WHEN a > 1 THEN d ELSE '42' END FROM csq_cast_param_inner);
......@@ -10918,7 +10918,7 @@ EXPLAIN SELECT a FROM ggg WHERE a NOT IN (NULL, '');
Gather Motion 3:1 (slice1; segments: 3) (cost=0.00..1.01 rows=1 width=2)
-> Seq Scan on ggg (cost=0.00..1.01 rows=1 width=2)
Filter: a <> ALL ('{NULL,""}'::bpchar[])
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(4 rows)
EXPLAIN SELECT a FROM ggg WHERE a IN (NULL, 'x');
......@@ -10928,7 +10928,7 @@ EXPLAIN SELECT a FROM ggg WHERE a IN (NULL, 'x');
-> Seq Scan on ggg (cost=0.00..1.01 rows=1 width=2)
Filter: (a = ANY ('{NULL,x}'::bpchar[]))
Planning time: 0.038 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(5 rows)
-- result node with one time filter and filter
......@@ -10987,7 +10987,7 @@ EXPLAIN WITH abc AS (SELECT onetimefilter1.a, onetimefilter1.b FROM onetimefilte
-> Broadcast Motion 3:3 (slice3; segments: 3) (cost=6.51..6.72 rows=4 width=8)
-> Shared Scan (share slice:id 3:0) (cost=6.51..6.72 rows=4 width=8)
Planning time: 0.276 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(43 rows)
WITH abc AS (SELECT onetimefilter1.a, onetimefilter1.b FROM onetimefilter1, onetimefilter2 WHERE onetimefilter1.a=onetimefilter2.a) SELECT (SELECT 1 FROM abc WHERE f1.b = f2.b LIMIT 1), COALESCE((SELECT 2 FROM abc WHERE f1.a=random() AND f1.a=2), 0), (SELECT b FROM abc WHERE b=f1.b) FROM onetimefilter1 f1, onetimefilter2 f2 WHERE f1.b = f2.b;
......
......@@ -49,7 +49,7 @@ EXPLAIN SELECT * FROM func1_nosql_vol(5), foo;
-> Materialize (cost=1.01..1.02 rows=1 width=8)
-> Seq Scan on foo (cost=0.00..1.01 rows=1 width=8)
Settings: optimizer=off
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
select gp_inject_fault('opt_relcache_translator_catalog_access', 'reset', 1);
......
......@@ -45,7 +45,7 @@ EXPLAIN SELECT * FROM func1_nosql_vol(5), foo;
-> Materialize (cost=1.01..1.02 rows=1 width=8)
-> Seq Scan on foo (cost=0.00..1.01 rows=1 width=8)
Settings: optimizer=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(8 rows)
select gp_inject_fault('opt_relcache_translator_catalog_access', 'reset', 1);
......
......@@ -9717,7 +9717,7 @@ DETAIL: No plan has been computed for required properties
Filter: i = 2 AND t = '2'::text
-> Seq Scan on bm_dyn_test_onepart_1_prt_part5 (cost=0.00..1.01 rows=1 width=10)
Filter: i = 2 AND t = '2'::text
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
select * from orca.bm_dyn_test_onepart where i=2 and t='2';
......@@ -10365,7 +10365,7 @@ DETAIL: DXL-to-PlStmt Translation: ScalarArrayOpExpr condition on index scan no
-> Seq Scan on btree_test (cost=0.00..2.25 rows=1 width=4)
Filter: a = ANY ('{1,47}'::integer[])
Settings: optimizer=on; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM btree_test WHERE a in ('2', 47);
......@@ -10377,7 +10377,7 @@ DETAIL: DXL-to-PlStmt Translation: ScalarArrayOpExpr condition on index scan no
-> Seq Scan on btree_test (cost=0.00..2.25 rows=1 width=4)
Filter: a = ANY ('{2,47}'::integer[])
Settings: optimizer=on; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM btree_test WHERE a in ('1', '2');
......@@ -10389,7 +10389,7 @@ DETAIL: DXL-to-PlStmt Translation: ScalarArrayOpExpr condition on index scan no
-> Seq Scan on btree_test (cost=0.00..2.25 rows=1 width=4)
Filter: a = ANY ('{1,2}'::integer[])
Settings: optimizer=on; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
EXPLAIN SELECT * FROM btree_test WHERE a in ('1', '2', 47);
......@@ -10401,7 +10401,7 @@ DETAIL: DXL-to-PlStmt Translation: ScalarArrayOpExpr condition on index scan no
-> Seq Scan on btree_test (cost=0.00..2.38 rows=1 width=4)
Filter: a = ANY ('{1,2,47}'::integer[])
Settings: optimizer=on; optimizer_metadata_caching=on
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(5 rows)
-- Test Bitmap index scan with in list
......@@ -10514,7 +10514,7 @@ LOG: Planner produced plan :0
-> Sort (cost=8552.10..8767.35 rows=28700 width=8)
Sort Key: a, b
-> Shared Scan (share slice:id 2:0) (cost=1391.50..1494.60 rows=28700 width=8)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(31 rows)
reset client_min_messages;
......
......@@ -47,7 +47,7 @@ ORDER BY 1 asc ;
-> Hash (cost=26.27..26.27 rows=676 width=20)
-> Seq Scan on my_tq_agg_small tq (cost=0.00..26.27 rows=676 width=20)
Settings: optimizer=off; optimizer_nestloop_factor=1
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(19 rows)
......
......@@ -1267,7 +1267,7 @@ select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 l
-> Limit
-> Seq Scan on int4_tbl
Filter: ((f1 < 10) AND (f1 > (-10)))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(16 rows)
select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 limit 1) ss on id = f1;
......@@ -1298,7 +1298,7 @@ select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 l
-> Limit
-> Seq Scan on int4_tbl
Filter: ((f1 < 10) AND (f1 > (-10)))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(16 rows)
select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 limit 1) ss on id = f1;
......@@ -1356,7 +1356,7 @@ explain (verbose, costs off) select * from matest0 order by 1-id;
Output: matest2.id, matest2.name
-> Seq Scan on public.matest3
Output: matest3.id, matest3.name
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_indexscan=off, optimizer=off
(19 rows)
......@@ -1389,7 +1389,7 @@ explain (verbose, costs off) select min(1-id) from matest0;
Output: matest2.id
-> Seq Scan on public.matest3
Output: matest3.id
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_indexscan=off, optimizer=off
(17 rows)
......@@ -1424,7 +1424,7 @@ explain (verbose, costs off) select * from matest0 order by 1-id;
Output: matest2.id, matest2.name, (1 - matest2.id)
-> Index Scan using matest3i on public.matest3
Output: matest3.id, matest3.name, (1 - matest3.id)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_bitmapscan=off, enable_seqscan=off, optimizer=off
(18 rows)
......@@ -1469,7 +1469,7 @@ explain (verbose, costs off) select min(1-id) from matest0;
-> Index Scan using matest3i on public.matest3
Output: matest3.id, (1 - matest3.id)
Index Cond: ((1 - matest3.id) IS NOT NULL)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_bitmapscan=off, enable_seqscan=off, optimizer=off
(29 rows)
......@@ -1519,7 +1519,7 @@ order by t1.b limit 10;
Filter: (c = d)
-> Seq Scan on matest1 t2_1
Filter: (c = d)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(19 rows)
reset enable_nestloop;
......@@ -1547,7 +1547,7 @@ ORDER BY thousand, tenthous;
-> Sort
Sort Key: tenk1_1.thousand, tenk1_1.thousand
-> Index Only Scan using tenk1_thous_tenthous on tenk1 tenk1_1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off)
......@@ -1565,7 +1565,7 @@ ORDER BY thousand, tenthous;
-> Sort
Sort Key: (42), (42)
-> Index Only Scan using tenk1_hundred on tenk1 tenk1_1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
explain (costs off)
......@@ -1583,7 +1583,7 @@ ORDER BY thousand, tenthous;
-> Sort
Sort Key: tenk1_1.thousand, ((random())::integer)
-> Index Only Scan using tenk1_thous_tenthous on tenk1 tenk1_1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
-- Check min/max aggregate optimization
......@@ -1602,7 +1602,7 @@ SELECT min(x) FROM
-> Append
-> Index Only Scan using tenk1_unique1 on tenk1 a
-> Index Only Scan using tenk1_unique2 on tenk1 b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
explain (costs off)
......@@ -1619,7 +1619,7 @@ SELECT min(y) FROM
-> Append
-> Index Only Scan using tenk1_unique1 on tenk1 a
-> Index Only Scan using tenk1_unique2 on tenk1 b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
-- XXX planner doesn't recognize that index on unique2 is sufficiently sorted
......@@ -1638,7 +1638,7 @@ ORDER BY x, y;
-> Append
-> Index Only Scan using tenk1_thous_tenthous on tenk1 a
-> Index Only Scan using tenk1_unique2 on tenk1 b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
-- exercise rescan code path via a repeatedly-evaluated subquery
......@@ -1665,7 +1665,7 @@ FROM generate_series(1, 3) g(i);
-> Sort
Sort Key: ((d_1.d + g.i))
-> Function Scan on generate_series d_1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
SELECT
......
......@@ -1280,7 +1280,7 @@ select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 l
-> Limit
-> Seq Scan on int4_tbl
Filter: ((f1 < 10) AND (f1 > (-10)))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(16 rows)
select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 limit 1) ss on id = f1;
......@@ -1311,7 +1311,7 @@ select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 l
-> Limit
-> Seq Scan on int4_tbl
Filter: ((f1 < 10) AND (f1 > (-10)))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(16 rows)
select * from patest0 join (select f1 from int4_tbl where f1 < 10 and f1 > -10 limit 1) ss on id = f1;
......@@ -1369,7 +1369,7 @@ explain (verbose, costs off) select * from matest0 order by 1-id;
Output: matest2.id, matest2.name
-> Seq Scan on public.matest3
Output: matest3.id, matest3.name
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_indexscan=off, optimizer=on
(19 rows)
......@@ -1402,7 +1402,7 @@ explain (verbose, costs off) select min(1-id) from matest0;
Output: matest2.id
-> Seq Scan on public.matest3
Output: matest3.id
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_indexscan=off, optimizer=off
(17 rows)
......@@ -1437,7 +1437,7 @@ explain (verbose, costs off) select * from matest0 order by 1-id;
Output: matest2.id, matest2.name, (1 - matest2.id)
-> Index Scan using matest3i on public.matest3
Output: matest3.id, matest3.name, (1 - matest3.id)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_bitmapscan=off, enable_seqscan=off, optimizer=on
(18 rows)
......@@ -1482,7 +1482,7 @@ explain (verbose, costs off) select min(1-id) from matest0;
-> Index Scan using matest3i on public.matest3
Output: matest3.id, (1 - matest3.id)
Index Cond: ((1 - matest3.id) IS NOT NULL)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: enable_bitmapscan=off, enable_seqscan=off, optimizer=off
(29 rows)
......@@ -1532,7 +1532,7 @@ order by t1.b limit 10;
Filter: (c = d)
-> Seq Scan on matest1 t2_1
Filter: (c = d)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(19 rows)
reset enable_nestloop;
......@@ -1678,7 +1678,7 @@ FROM generate_series(1, 3) g(i);
-> Sort
Sort Key: ((d_1.d + g.i))
-> Function Scan on generate_series d_1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
SELECT
......
......@@ -125,7 +125,7 @@ EXPLAIN ANALYZE SELECT count(*) FROM a a1, a a2, a a3;
(slice2) Executor memory: 62K bytes avg x 3 workers, 62K bytes max (seg0).
(slice3) Executor memory: 158K bytes avg x 3 workers, 158K bytes max (seg0).
Memory used: 128000kB
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Execution time: 73.541 ms
(20 rows)
......@@ -144,7 +144,7 @@ EXPLAIN SELECT count(*) FROM a where id < (1/(select count(*) where 1=0));
-> Seq Scan on a (cost=0.00..3.75 rows=6 width=0)
Filter: (id < (1 / $0))
Planning time: 0.414 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
EXPLAIN SELECT count(*) FROM a a1, a a2, a a3;
......@@ -163,7 +163,7 @@ EXPLAIN SELECT count(*) FROM a a1, a a2, a a3;
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..5.50 rows=50 width=0)
-> Seq Scan on a a3 (cost=0.00..3.50 rows=17 width=0)
Planning time: 0.556 ms
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
-- Expected result is 1 row, means only current query in instrument slots,
......
......@@ -262,7 +262,7 @@ SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
Sort Key: f1
-> Bitmap Heap Scan on interval_tbl_of r1
-> Bitmap Index Scan on interval_tbl_of_f1_idx
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
SELECT f1 FROM INTERVAL_TBL_OF r1 ORDER BY f1;
......
此差异已折叠。
......@@ -165,7 +165,7 @@ explain select * from t1,t2 where t1.x = 100 and t1.x = t2.y and t1.x <= t2.x;
-> Seq Scan on t2 (cost=0.00..4.75 rows=1 width=12)
Filter: ((100 <= x) AND (y <= x) AND (y = 100))
Settings: optimizer=off; optimizer_segments=2
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(11 rows)
reset optimizer_segments;
......@@ -321,7 +321,7 @@ explain select a from foo where a<1 and a>1 and not exists (select c from bar wh
------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0)
One-Time Filter: false
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(3 rows)
select a from foo where a<1 and a>1 and not exists (select c from bar where c=a);
......@@ -506,7 +506,7 @@ explain (costs off) select X.a from input_table X full join (select a from input
-> Sort
Sort Key: input_table.a
-> Seq Scan on input_table
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
-- Cleanup
......@@ -537,7 +537,7 @@ explain select * from t5370 a , t5370_2 b where a.name=b.name;
-> Redistribute Motion 3:3 (slice2; segments: 3) (cost=0.00..33.00 rows=334 width=7)
Hash Key: b.name
-> Seq Scan on t5370_2 b (cost=0.00..13.00 rows=334 width=7)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
drop table t5370;
......@@ -566,7 +566,7 @@ explain (costs off) select * from t6215 a full join t6215 b on true;
-> Seq Scan on t6215 a
-> Materialize
-> Seq Scan on t6215 b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(6 rows)
select * from t6215 a full join t6215 b on true;
......@@ -629,7 +629,7 @@ explain (costs off) select * from t1 left join t2 on (t1.a = t2.a) join t3 on (t
-> Hash
-> Broadcast Motion 3:3 (slice1; segments: 3)
-> Seq Scan on t3
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
select * from t1 left join t2 on (t1.a = t2.a) join t3 on (t1.b = t3.b) where (t2.a IS NULL OR (t1.c = t3.c));
......@@ -652,7 +652,7 @@ explain (costs off) select * from t1 left join t2 on (t1.a = t2.a) join t3 on (t
-> Seq Scan on t2
-> Hash
-> Seq Scan on t3
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(11 rows)
select * from t1 left join t2 on (t1.a = t2.a) join t3 on (t1.b = t3.b) where (t2.a = t3.a);
......@@ -676,7 +676,7 @@ explain (costs off) select * from t1 left join t2 on (t1.a = t2.a) join t3 on (t
-> Hash
-> Broadcast Motion 3:3 (slice1; segments: 3)
-> Seq Scan on t3
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(13 rows)
select * from t1 left join t2 on (t1.a = t2.a) join t3 on (t1.b = t3.b) where (t2.a is distinct from t3.a);
......@@ -701,7 +701,7 @@ explain select * from t3 join (select t1.a t1a, t1.b t1b, t1.c t1c, t2.a t2a, t2
-> Seq Scan on t1 (cost=0.00..13.00 rows=334 width=12)
-> Hash (cost=2.02..2.02 rows=1 width=12)
-> Seq Scan on t3 (cost=0.00..2.02 rows=1 width=12)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(12 rows)
select * from t3 join (select t1.a t1a, t1.b t1b, t1.c t1c, t2.a t2a, t2.b t2b, t2.c t2c from t1 left join t2 on (t1.a = t2.a)) t on (t1a = t3.a) WHERE (t2a IS NULL OR (t1c = t3.a));
......@@ -743,7 +743,7 @@ explain select * from (select t1.a t1a, t1.b t1b, t2.a t2a, t2.b t2b from t1 lef
-> Hash (cost=2.10..2.10 rows=2 width=12)
-> Broadcast Motion 3:3 (slice2; segments: 3) (cost=0.00..2.10 rows=2 width=12)
-> Seq Scan on t3 t3_1 (cost=0.00..2.02 rows=1 width=12)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(27 rows)
select * from (select t1.a t1a, t1.b t1b, t2.a t2a, t2.b t2b from t1 left join t2 on t1.a = t2.a) tt
......@@ -768,7 +768,7 @@ drop table t1, t2, t3;
-- for further improvement (e.g. referring subplan code to do broadcast
-- for base rel if needed, which needs much effort and does not seem to
-- be deserved given we will probably refactor related code for the lateral
-- support in the near future). For the query and guc settings below, legacy
-- support in the near future). For the query and guc settings below, Postgres
-- planner can not generate a plan.
set enable_nestloop = 1;
set enable_material = 0;
......@@ -785,7 +785,7 @@ explain select tenk1.unique2 >= 0 from tenk1 left join tenk2 on true limit 1;
-> Materialize (cost=0.16..18479.11 rows=10000 width=0)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.16..18329.11 rows=10000 width=0)
-> Index Only Scan using tenk2_unique2 on tenk2 (cost=0.16..17929.11 rows=3334 width=0)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select tenk1.unique2 >= 0 from tenk1 left join tenk2 on true limit 1;
......
......@@ -819,7 +819,7 @@ drop table t1, t2, t3;
-- for further improvement (e.g. referring subplan code to do broadcast
-- for base rel if needed, which needs much effort and does not seem to
-- be deserved given we will probably refactor related code for the lateral
-- support in the near future). For the query and guc settings below, legacy
-- support in the near future). For the query and guc settings below, Postgres
-- planner can not generate a plan.
set enable_nestloop = 1;
set enable_material = 0;
......
......@@ -2177,7 +2177,7 @@ select aa, bb, unique1, unique1
-----------------------------------
Result
One-Time Filter: false
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(3 rows)
select aa, bb, unique1, unique1
......@@ -3560,7 +3560,7 @@ left join unnest(v1ys) as u1(u1y) on u1y = v2y;
-> Function Scan on unnest u1
-> Hash
-> Values Scan on "*VALUES*_1"
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(9 rows)
select * from
......@@ -4174,7 +4174,7 @@ where ss1.c2 = 0;
Output: (i41.f1), (i8.q1), (i8.q2), (i42.f1), (i43.f1), ((42))
-> Seq Scan on public.text_tbl
Output: i41.f1, i8.q1, i8.q2, i42.f1, i43.f1, (42)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=on
(42 rows)
......@@ -4706,7 +4706,7 @@ explain (costs off)
-> Seq Scan on tenk1 a
-> Hash
-> Seq Scan on int4_tbl b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select unique2, x.*
......@@ -4727,7 +4727,7 @@ explain (costs off)
-> Seq Scan on tenk1
-> Hash
-> Seq Scan on int4_tbl x
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
explain (costs off)
......@@ -4741,7 +4741,7 @@ explain (costs off)
-> Seq Scan on tenk1
-> Hash
-> Seq Scan on int4_tbl x
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
select unique2, x.*
......@@ -4766,7 +4766,7 @@ explain (costs off)
-> Seq Scan on tenk1
-> Hash
-> Seq Scan on int4_tbl x
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- check scoping of lateral versus parent references
......@@ -4808,7 +4808,7 @@ explain (costs off)
-> Nested Loop
-> Seq Scan on tenk1 a
-> Function Scan on generate_series g
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
explain (costs off)
......@@ -4821,7 +4821,7 @@ explain (costs off)
-> Nested Loop
-> Seq Scan on tenk1 a
-> Function Scan on generate_series g
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- don't need the explicit LATERAL keyword for functions
......@@ -4835,7 +4835,7 @@ explain (costs off)
-> Nested Loop
-> Seq Scan on tenk1 a
-> Function Scan on generate_series g
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(7 rows)
-- lateral with UNION ALL subselect
......@@ -4854,7 +4854,7 @@ explain (costs off)
Filter: (g.g = q1)
-> Seq Scan on int8_tbl b
Filter: (g.g = q2)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
select * from generate_series(100,200) g,
......@@ -4887,7 +4887,7 @@ explain (costs off)
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: b.unique2
-> Seq Scan on tenk1 b
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(15 rows)
select count(*) from tenk1 a,
......@@ -5226,7 +5226,7 @@ select * from
-> Seq Scan on public.int8_tbl b
Output: b.q1, b.q2, a.q2
Filter: (a.q2 = b.q1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(14 rows)
......@@ -5265,7 +5265,7 @@ select * from
-> Seq Scan on public.int8_tbl b
Output: b.q1, b.q2, COALESCE(a.q2, 42::bigint)
Filter: (a.q2 = b.q1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(14 rows)
......@@ -5304,7 +5304,7 @@ select * from int4_tbl i left join
Output: j.f1
-> Seq Scan on public.int2_tbl j
Output: j.f1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(13 rows)
......@@ -5333,7 +5333,7 @@ select * from int4_tbl i left join
-> Seq Scan on public.int2_tbl j
Output: j.f1, COALESCE(i.*)
Filter: (i.f1 = j.f1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(11 rows)
......@@ -5375,7 +5375,7 @@ select * from int4_tbl a,
Output: b.f1
-> Seq Scan on public.int4_tbl b
Output: b.f1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(22 rows)
......@@ -5447,7 +5447,7 @@ select * from
Output: c.q1
-> Seq Scan on public.int8_tbl c
Output: c.q1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(24 rows)
......@@ -5551,7 +5551,7 @@ select * from
Output: ((COALESCE((COALESCE(b.q2, 42::bigint)), d.q2)))
-> Result
Output: (COALESCE((COALESCE(b.q2, 42::bigint)), d.q2))
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(38 rows)
......@@ -5617,7 +5617,7 @@ select c.*,a.*,ss1.q1,ss2.q1,ss3.* from
Output: i.f1
-> Seq Scan on public.int4_tbl i
Output: i.f1
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
Settings: optimizer=off
(50 rows)
......@@ -5645,7 +5645,7 @@ select * from
Output: (3)
-> Result
Output: 3
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(16 rows)
-- check handling of nested appendrels inside LATERAL
......@@ -5701,7 +5701,7 @@ select * from
Output: tenk1.unique1, tenk1.unique2
-> Seq Scan on public.tenk1
Output: tenk1.unique1, tenk1.unique2
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(22 rows)
select * from
......
......@@ -30,7 +30,7 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur
-> HashAggregate
Group Key: t.type
-> Seq Scan on t
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(8 rows)
CREATE MATERIALIZED VIEW tm AS SELECT type, sum(amt) AS totamt FROM t GROUP BY type WITH NO DATA;
......@@ -75,7 +75,7 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur
-> HashAggregate
Group Key: t.type
-> Seq Scan on t
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(10 rows)
CREATE MATERIALIZED VIEW tvm AS SELECT * FROM tv ORDER BY type;
......@@ -111,7 +111,7 @@ HINT: The 'DISTRIBUTED BY' clause determines the distribution of data. Make sur
-> HashAggregate
Group Key: t.type
-> Seq Scan on t
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(14 rows)
CREATE MATERIALIZED VIEW tvvm AS SELECT * FROM tvv;
......@@ -242,7 +242,7 @@ EXPLAIN (costs off)
QUERY PLAN
-----------------------------------
Seq Scan on tmm
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(2 rows)
EXPLAIN (costs off)
......@@ -251,7 +251,7 @@ EXPLAIN (costs off)
------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Seq Scan on tvmm
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(3 rows)
EXPLAIN (costs off)
......@@ -260,7 +260,7 @@ EXPLAIN (costs off)
------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Seq Scan on tvvm
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(3 rows)
SELECT * FROM tmm;
......@@ -292,7 +292,7 @@ EXPLAIN (costs off)
QUERY PLAN
-----------------------------------
Seq Scan on tmm
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(2 rows)
EXPLAIN (costs off)
......@@ -301,7 +301,7 @@ EXPLAIN (costs off)
------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Seq Scan on tvmm
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(3 rows)
EXPLAIN (costs off)
......@@ -310,7 +310,7 @@ EXPLAIN (costs off)
------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Seq Scan on tvvm
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(3 rows)
SELECT * FROM tmm;
......
此差异已折叠。
......@@ -421,7 +421,7 @@ explain select x,y from l1 where (x,y) not in
Group Key: l1_1.y
-> Seq Scan on l1 l1_1 (cost=0.00..3.12 rows=2 width=8)
Filter: y < 4
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(19 rows)
select x,y from l1 where (x,y) not in
......@@ -451,7 +451,7 @@ explain select * from g1 where (a,b,c) not in
-> Materialize (cost=3.53..3.83 rows=10 width=12)
-> Broadcast Motion 3:3 (slice1; segments: 3) (cost=0.00..3.50 rows=10 width=12)
-> Seq Scan on l1 (cost=0.00..3.10 rows=4 width=12)
Optimizer status: legacy query optimizer
Optimizer status: Postgres query optimizer
(10 rows)
select * from g1 where (a,b,c) not in
......
......@@ -6887,7 +6887,7 @@ explain select foo_p.b, foo_p.t from foo_p left outer join bar on foo_p.a = bar.
Filter: t IS NOT NULL AND a = ('{1}'::integer[])[1]
-> Seq Scan on foo_p_1_prt_6 (cost=0.00..5.50 rows=1 width=34)
Filter: t IS NOT NULL AND a = ('{1}'::integer[])[1]
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(21 rows)
reset optimizer_segments;
......
......@@ -1589,7 +1589,7 @@ ERROR: table "b" does not exist
-- MPP-3988: allow same column in multiple partitioning keys at
-- different levels -- so this is legal again...
drop table if exists a;
-- TEST: make sure GPOPT (aka pivotal query optimizer) fall back to legacy query optimizer
-- TEST: make sure GPOPT (aka pivotal query optimizer) fall back to Postgres query optimizer
-- for queries with partition elimination over FULL OUTER JOIN
-- between partitioned tables.
-- SETUP
......@@ -1617,7 +1617,7 @@ NOTICE: CREATE TABLE will create partition "s2_1_prt_1" for table "s2"
NOTICE: CREATE TABLE will create partition "s2_1_prt_2" for table "s2"
-- end_ignore
-- VERIFY
-- expect GPOPT fall back to legacy query optimizer
-- expect GPOPT fall back to Postgres query optimizer
-- since GPOPT don't support partition elimination through full outer joins
select * from s1 full outer join s2 on s1.d1 = s2.d2 and s1.p1 = s2.p2 where s1.p1 = 1;
d1 | p1 | d2 | p2
......
......@@ -1725,7 +1725,7 @@ EXPLAIN SELECT * FROM pt_complex WHERE i = 1 AND j = 1;
Filter: (j = 1)
-> Bitmap Index Scan on pt_complex_1_prt_p2_2_prt_p11_3_prt_p12_i_idx (cost=0.00..100.65 rows=22 width=0)
Index Cond: (i = 1)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(23 rows)
--
......
......@@ -1000,7 +1000,7 @@ DECLARE c1 CURSOR FOR SELECT stringu1 FROM onek WHERE stringu1 = 'DZAAAA';
Gather Motion 3:1 (slice1; segments: 3)
-> Seq Scan on onek
Filter: (stringu1 = 'DZAAAA'::name)
Optimizer: legacy query optimizer
Optimizer: Postgres query optimizer
(4 rows)
DECLARE c1 CURSOR FOR SELECT stringu1 FROM onek WHERE stringu1 = 'DZAAAA';
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册