This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/cbdb-postgres-merge by this
push:
new 77545cbbb30 Fix some answer files
77545cbbb30 is described below
commit 77545cbbb30a04e02e7633e0aa7e1ea75242b498
Author: Jinbao Chen <[email protected]>
AuthorDate: Mon Jan 26 23:19:04 2026 +0800
Fix some answer files
---
.../regress/expected/alter_db_set_tablespace.out | 34 ++--
src/test/regress/expected/bfv_aggregate.out | 2 +-
src/test/regress/expected/bfv_partition_plans.out | 12 +-
src/test/regress/expected/bitmap_index.out | 12 ++
src/test/regress/expected/partition_prune.out | 16 +-
src/test/regress/expected/qp_full_join.out | 112 ++++++-----
src/test/regress/expected/qp_join_universal.out | 4 +-
src/test/regress/expected/window.out | 221 +++++++++++----------
src/test/regress/sql/bitmap_index.sql | 2 +
9 files changed, 230 insertions(+), 185 deletions(-)
diff --git a/src/test/regress/expected/alter_db_set_tablespace.out
b/src/test/regress/expected/alter_db_set_tablespace.out
index cffe5545395..c09a1634ec4 100644
--- a/src/test/regress/expected/alter_db_set_tablespace.out
+++ b/src/test/regress/expected/alter_db_set_tablespace.out
@@ -25,12 +25,10 @@ except OSError:
plpy.debug('failed to remove tablespace location directory: %s' %
(tablespace_location_dir))
os.mkdir(tablespace_location_dir)
$$ LANGUAGE plpython3u;
-\set adst_source_tablespace_location @testtablespace@/adst_source
-\set adst_destination_tablespace_location @testtablespace@/adst_dest
-CREATE or REPLACE FUNCTION setup() RETURNS VOID AS $$
-DECLARE
- adst_source_tablespace_location text := '@testtablespace@/adst_source';
- adst_destination_tablespace_location text := '@testtablespace@/adst_dest';
+\getenv abs_builddir PG_ABS_BUILDDIR
+\set adst_source_tablespace_location :abs_builddir
'/testtablespace/adst_source'
+\set adst_destination_tablespace_location :abs_builddir
'/testtablespace/adst_dest'
+CREATE or REPLACE FUNCTION setup(adst_source_tablespace_location text,
adst_destination_tablespace_location text) RETURNS VOID AS $$
BEGIN
-- Setup tablespace directories
PERFORM
setup_tablespace_location_dir_for_test(adst_source_tablespace_location);
@@ -147,7 +145,7 @@ $fn$;
-- | M1 | deleted | moved | XLOG_XACT_COMMIT_PREPARED | |
-- | M2 | deleted | moved | XLOG_XACT_COMMIT_PREPARED | |
-- +---------+-----------+-----------+------------------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -256,7 +254,7 @@ SELECT force_mirrors_to_catch_up();
-- | Master | remains | deleted | pendingDbDeletes | E |
-- | SMaster | remains | deleted | XLOG_XACT_ABORT | |
-- +---------+-----------+-----------+-------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -370,7 +368,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT | |
-- +---------+-----------+-----------+-------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -499,7 +497,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT | |
-- +---------+-----------+-----------+-------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -635,7 +633,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- +---------+-----------+-----------+--------------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -755,7 +753,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- +---------+-----------+-----------+--------------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -882,7 +880,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- +---------+-----------+-----------+--------------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -1001,7 +999,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- +-------------+-----------+-----------+--------------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -1132,7 +1130,7 @@ SELECT force_mirrors_to_catch_up();
-- | M1 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- | M2 | remains | deleted | XLOG_XACT_ABORT_PREPARED | |
-- +-------------+-----------+-----------+--------------------------+-------+
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -1294,7 +1292,7 @@ SELECT gp_wait_until_triggered_fault('ckpt_loop_begin',
1, mirror0());
Success:
(1 row)
-SELECT setup();
+SELECT setup(:'adst_source_tablespace_location',
:'adst_destination_tablespace_location');
setup
-------
@@ -1364,8 +1362,8 @@ SELECT gp_inject_fault('all', 'reset', dbid) FROM
gp_segment_configuration;
Success:
(8 rows)
-\!rm -rf @testtablespace@/adst_source
-\!rm -rf @testtablespace@/adst_dest
+\!rm -rf $PG_ABS_BUILDDIR/testtablespace/adst_source
+\!rm -rf $PG_ABS_BUILDDIR/testtablespace/adst_dest
--- start_ignore
-- Set fsync on because it is the value before the test
\! gpconfig -c fsync -v on --skipvalidation;
diff --git a/src/test/regress/expected/bfv_aggregate.out
b/src/test/regress/expected/bfv_aggregate.out
index c21b74f86bf..57cbb2b4aa6 100644
--- a/src/test/regress/expected/bfv_aggregate.out
+++ b/src/test/regress/expected/bfv_aggregate.out
@@ -1777,7 +1777,7 @@ explain (costs off)
select 1, sum(col1) from group_by_const group by 1;
QUERY PLAN
------------------------------------------------
- Finalize GroupAggregate
+ Finalize Aggregate
-> Gather Motion 3:1 (slice1; segments: 3)
-> Partial GroupAggregate
-> Seq Scan on group_by_const
diff --git a/src/test/regress/expected/bfv_partition_plans.out
b/src/test/regress/expected/bfv_partition_plans.out
index 386491ea236..034624e6d17 100644
--- a/src/test/regress/expected/bfv_partition_plans.out
+++ b/src/test/regress/expected/bfv_partition_plans.out
@@ -1236,11 +1236,11 @@ EXPLAIN (COSTS OFF, TIMING OFF, SUMMARY OFF, ANALYZE)
DELETE FROM delete_from_pt
-> Hash Semi Join (actual rows=1 loops=1)
Hash Cond: (delete_from_pt.b = t.a)
Extra Text: (seg0) Hash chain length 2.0 avg, 2 max, using 1 of
131072 buckets.
- -> Append (actual rows=5 loops=1)
+ -> Append (actual rows=3 loops=1)
Partition Selectors: $1
-> Seq Scan on delete_from_pt_1_prt_1 delete_from_pt_2 (actual
rows=3 loops=1)
- -> Seq Scan on delete_from_pt_1_prt_2 delete_from_pt_3 (actual
rows=3 loops=1)
- -> Seq Scan on delete_from_pt_1_prt_3 delete_from_pt_4 (actual
rows=0 loops=1)
+ -> Seq Scan on delete_from_pt_1_prt_2 delete_from_pt_3 (never
executed)
+ -> Seq Scan on delete_from_pt_1_prt_3 delete_from_pt_4 (never
executed)
-> Hash (actual rows=2 loops=1)
Buckets: 131072 Batches: 1 Memory Usage: 1025kB
-> Partition Selector (selector id: $1) (actual rows=2 loops=1)
@@ -1248,11 +1248,11 @@ EXPLAIN (COSTS OFF, TIMING OFF, SUMMARY OFF, ANALYZE)
DELETE FROM delete_from_pt
-> Hash Join (actual rows=1 loops=1)
Hash Cond: (delete_from_pt_1.b = t.a)
Extra Text: (seg0) Hash chain length 1.0
avg, 1 max, using 1 of 262144 buckets.
- -> Append (actual rows=5 loops=1)
+ -> Append (actual rows=3 loops=1)
Partition Selectors: $2
-> Seq Scan on delete_from_pt_1_prt_1
delete_from_pt_5 (actual rows=3 loops=1)
- -> Seq Scan on delete_from_pt_1_prt_2
delete_from_pt_6 (actual rows=3 loops=1)
- -> Seq Scan on delete_from_pt_1_prt_3
delete_from_pt_7 (actual rows=0 loops=1)
+ -> Seq Scan on delete_from_pt_1_prt_2
delete_from_pt_6 (never executed)
+ -> Seq Scan on delete_from_pt_1_prt_3
delete_from_pt_7 (never executed)
-> Hash (actual rows=1 loops=1)
Buckets: 262144 Batches: 1 Memory
Usage: 2049kB
-> Partition Selector (selector id:
$2) (actual rows=1 loops=1)
diff --git a/src/test/regress/expected/bitmap_index.out
b/src/test/regress/expected/bitmap_index.out
index 61f8e7323ef..62cebf71cbf 100644
--- a/src/test/regress/expected/bitmap_index.out
+++ b/src/test/regress/expected/bitmap_index.out
@@ -719,6 +719,12 @@ WARNING: consider disabling FTS probes while injecting a
panic.
SET client_min_messages='ERROR';
CREATE TABLE trigger_recovery_on_primaries(c int);
RESET client_min_messages;
+SELECT pg_sleep(2);
+ pg_sleep
+----------
+
+(1 row)
+
-- reconnect to the database after restart
\c
SELECT gp_inject_fault('checkpoint', 'reset', dbid) FROM
gp_segment_configuration WHERE role = 'p' AND content > -1;
@@ -729,6 +735,12 @@ SELECT gp_inject_fault('checkpoint', 'reset', dbid) FROM
gp_segment_configuratio
Success:
(3 rows)
+SELECT pg_sleep(2);
+ pg_sleep
+----------
+
+(1 row)
+
SELECT gp_inject_fault('finish_prepared_after_record_commit_prepared',
'reset', dbid) FROM gp_segment_configuration WHERE role = 'p' AND content > -1;
gp_inject_fault
-----------------
diff --git a/src/test/regress/expected/partition_prune.out
b/src/test/regress/expected/partition_prune.out
index e4e3b1e464e..96baf6cbb4e 100644
--- a/src/test/regress/expected/partition_prune.out
+++ b/src/test/regress/expected/partition_prune.out
@@ -3070,8 +3070,8 @@ select explain_parallel_append('select avg(ab.a) from ab
inner join lprt_a a on
delete from lprt_a where a = 1;
select explain_parallel_append('select avg(ab.a) from ab inner join lprt_a a
on ab.a = a.a where a.a in(1, 0, 0)');
- explain_parallel_append
--------------------------------------------------------------------------------------------------------
+ explain_parallel_append
+------------------------------------------------------------------------------------------------
Finalize Aggregate (actual rows=N loops=N)
-> Gather Motion 1:1 (slice1; segments: 1) (actual rows=N loops=N)
-> Partial Aggregate (actual rows=N loops=N)
@@ -3082,17 +3082,17 @@ select explain_parallel_append('select avg(ab.a) from
ab inner join lprt_a a on
Sort Method: quicksort Memory: 25kB
-> Append (actual rows=N loops=N)
Partition Selectors: $0
- -> Bitmap Heap Scan on ab_a1_b1 ab_1 (actual
rows=N loops=N)
+ -> Bitmap Heap Scan on ab_a1_b1 ab_1 (never
executed)
Recheck Cond: (a = ANY
('{1,0,0}'::integer[]))
- -> Bitmap Index Scan on ab_a1_b1_a_idx
(actual rows=N loops=N)
+ -> Bitmap Index Scan on ab_a1_b1_a_idx
(never executed)
Index Cond: (a = ANY
('{1,0,0}'::integer[]))
- -> Bitmap Heap Scan on ab_a1_b2 ab_2 (actual
rows=N loops=N)
+ -> Bitmap Heap Scan on ab_a1_b2 ab_2 (never
executed)
Recheck Cond: (a = ANY
('{1,0,0}'::integer[]))
- -> Bitmap Index Scan on ab_a1_b2_a_idx
(actual rows=N loops=N)
+ -> Bitmap Index Scan on ab_a1_b2_a_idx
(never executed)
Index Cond: (a = ANY
('{1,0,0}'::integer[]))
- -> Bitmap Heap Scan on ab_a1_b3 ab_3 (actual
rows=N loops=N)
+ -> Bitmap Heap Scan on ab_a1_b3 ab_3 (never
executed)
Recheck Cond: (a = ANY
('{1,0,0}'::integer[]))
- -> Bitmap Index Scan on ab_a1_b3_a_idx
(actual rows=N loops=N)
+ -> Bitmap Index Scan on ab_a1_b3_a_idx
(never executed)
Index Cond: (a = ANY
('{1,0,0}'::integer[]))
-> Sort (actual rows=N loops=N)
Sort Key: a.a
diff --git a/src/test/regress/expected/qp_full_join.out
b/src/test/regress/expected/qp_full_join.out
index 5ff276750e7..4da6e4567f6 100644
--- a/src/test/regress/expected/qp_full_join.out
+++ b/src/test/regress/expected/qp_full_join.out
@@ -326,40 +326,44 @@ create view vw_rep2 as (select rep.c1 as c11, rep2.c1 as
c12 from rep full join
--
-- (distributed ⟗ distributed) ⟕ random
explain (costs off, timing off, summary off) select * from vw_dist left join
rand on vw_dist.c11 = rand.c1;
- QUERY PLAN
-------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
- -> Hash Right Join
- Hash Cond: (rand.c1 = dist.c1)
+ -> Hash Left Join
+ Hash Cond: (dist.c1 = rand.c1)
-> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: rand.c1
- -> Seq Scan on rand
- -> Hash
+ Hash Key: dist.c1
-> Hash Full Join
Hash Cond: (dist2.c1 = dist.c1)
-> Seq Scan on dist2
-> Hash
-> Seq Scan on dist
- Optimizer: Postgres-based planner
-(13 rows)
+ -> Hash
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
+ Hash Key: rand.c1
+ -> Seq Scan on rand
+ Optimizer: Postgres query optimizer
+(15 rows)
explain (costs off, timing off, summary off) select * from vw_dist left join
rand on vw_dist.c12 = rand.c1;
- QUERY PLAN
-------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
- -> Hash Right Join
- Hash Cond: (rand.c1 = dist2.c1)
+ -> Hash Left Join
+ Hash Cond: (dist2.c1 = rand.c1)
-> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: rand.c1
- -> Seq Scan on rand
- -> Hash
+ Hash Key: dist2.c1
-> Hash Full Join
Hash Cond: (dist2.c1 = dist.c1)
-> Seq Scan on dist2
-> Hash
-> Seq Scan on dist
- Optimizer: Postgres-based planner
-(13 rows)
+ -> Hash
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
+ Hash Key: rand.c1
+ -> Seq Scan on rand
+ Optimizer: Postgres query optimizer
+(15 rows)
explain (costs off, timing off, summary off) select * from vw_dist left join
rand on vw_dist.c11 is not distinct from rand.c1;
QUERY PLAN
@@ -421,40 +425,44 @@ select count(*) from vw_dist left join rand on
vw_dist.c12 is not distinct from
-- (distributed ⟗ distributed) ⟗ random
explain (costs off, timing off, summary off) select * from vw_dist full join
rand on vw_dist.c11 = rand.c1;
- QUERY PLAN
-------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Hash Full Join
- Hash Cond: (rand.c1 = dist.c1)
+ Hash Cond: (dist.c1 = rand.c1)
-> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: rand.c1
- -> Seq Scan on rand
- -> Hash
+ Hash Key: dist.c1
-> Hash Full Join
Hash Cond: (dist2.c1 = dist.c1)
-> Seq Scan on dist2
-> Hash
-> Seq Scan on dist
- Optimizer: Postgres-based planner
-(13 rows)
+ -> Hash
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
+ Hash Key: rand.c1
+ -> Seq Scan on rand
+ Optimizer: Postgres query optimizer
+(15 rows)
explain (costs off, timing off, summary off) select * from vw_dist full join
rand on vw_dist.c12 = rand.c1;
- QUERY PLAN
-------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Hash Full Join
- Hash Cond: (rand.c1 = dist2.c1)
+ Hash Cond: (dist2.c1 = rand.c1)
-> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: rand.c1
- -> Seq Scan on rand
- -> Hash
+ Hash Key: dist2.c1
-> Hash Full Join
Hash Cond: (dist2.c1 = dist.c1)
-> Seq Scan on dist2
-> Hash
-> Seq Scan on dist
- Optimizer: Postgres-based planner
-(13 rows)
+ -> Hash
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
+ Hash Key: rand.c1
+ -> Seq Scan on rand
+ Optimizer: Postgres query optimizer
+(15 rows)
explain (costs off, timing off, summary off) select * from vw_dist full join
rand on vw_dist.c11 is not distinct from rand.c1;
ERROR: FULL JOIN is only supported with merge-joinable or hash-joinable join
conditions
@@ -537,40 +545,44 @@ select count(*) from rand left join vw_dist on rand.c1 =
vw_dist.c12;
-- random ⟗ (distributed ⟗ distributed)
explain (costs off, timing off, summary off) select * from rand full join
vw_dist on rand.c1 = vw_dist.c11;
- QUERY PLAN
-------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Hash Full Join
- Hash Cond: (rand.c1 = dist.c1)
+ Hash Cond: (dist.c1 = rand.c1)
-> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: rand.c1
- -> Seq Scan on rand
- -> Hash
+ Hash Key: dist.c1
-> Hash Full Join
Hash Cond: (dist2.c1 = dist.c1)
-> Seq Scan on dist2
-> Hash
-> Seq Scan on dist
- Optimizer: Postgres-based planner
-(13 rows)
+ -> Hash
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
+ Hash Key: rand.c1
+ -> Seq Scan on rand
+ Optimizer: Postgres query optimizer
+(15 rows)
explain (costs off, timing off, summary off) select * from rand full join
vw_dist on rand.c1 = vw_dist.c12;
- QUERY PLAN
-------------------------------------------------------------
+ QUERY PLAN
+------------------------------------------------------------------
Gather Motion 3:1 (slice1; segments: 3)
-> Hash Full Join
- Hash Cond: (rand.c1 = dist2.c1)
+ Hash Cond: (dist2.c1 = rand.c1)
-> Redistribute Motion 3:3 (slice2; segments: 3)
- Hash Key: rand.c1
- -> Seq Scan on rand
- -> Hash
+ Hash Key: dist2.c1
-> Hash Full Join
Hash Cond: (dist2.c1 = dist.c1)
-> Seq Scan on dist2
-> Hash
-> Seq Scan on dist
- Optimizer: Postgres-based planner
-(13 rows)
+ -> Hash
+ -> Redistribute Motion 3:3 (slice3; segments: 3)
+ Hash Key: rand.c1
+ -> Seq Scan on rand
+ Optimizer: Postgres query optimizer
+(15 rows)
select count(*) from rand full join vw_dist on rand.c1 = vw_dist.c11;
count
diff --git a/src/test/regress/expected/qp_join_universal.out
b/src/test/regress/expected/qp_join_universal.out
index f44ed7ef075..df2f820d257 100644
--- a/src/test/regress/expected/qp_join_universal.out
+++ b/src/test/regress/expected/qp_join_universal.out
@@ -221,11 +221,11 @@ explain (analyze, costs off, timing off, summary off)
select * from part join un
-> Hash Join (actual rows=150 loops=1)
Hash Cond: (part.c2 =
(((unnest('{-3,-2,-1,0,1,2,3}'::text[])))::integer))
Extra Text: (seg0) Hash chain length 1.0 avg, 1 max, using 7 of
524288 buckets.
- -> Append (actual rows=340 loops=1)
+ -> Append (actual rows=245 loops=1)
Partition Selectors: $0
-> Seq Scan on part_1_prt_part3 part_1 (actual rows=106
loops=1)
-> Seq Scan on part_1_prt_part1 part_2 (actual rows=150
loops=1)
- -> Seq Scan on part_1_prt_part2 part_3 (actual rows=113
loops=1)
+ -> Seq Scan on part_1_prt_part2 part_3 (never executed)
-> Hash (actual rows=7 loops=1)
Buckets: 524288 Batches: 1 Memory Usage: 4097kB
-> Partition Selector (selector id: $0) (actual rows=7 loops=1)
diff --git a/src/test/regress/expected/window.out
b/src/test/regress/expected/window.out
index 31e3b5271b2..95167244464 100644
--- a/src/test/regress/expected/window.out
+++ b/src/test/regress/expected/window.out
@@ -452,21 +452,22 @@ explain SELECT * FROM (SELECT dense_rank() OVER
(PARTITION BY four ORDER BY ten)
(12 rows)
explain SELECT * FROM (SELECT percent_rank() OVER (PARTITION BY four ORDER BY
ten) AS rank_1, ten, four FROM tenk1 WHERE unique2 < 10) t WHERE rank_1 < 0.5;
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3) (cost=8.60..8.80 rows=10 width=16)
- -> WindowAgg (cost=8.60..8.67 rows=3 width=16)
- Run Condition: (percent_rank() OVER (?) < '0.5'::double precision)
- Partition By: tenk1.four
- Order By: tenk1.ten
- -> Sort (cost=8.60..8.61 rows=3 width=8)
- Sort Key: tenk1.four, tenk1.ten
- -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.16..8.57 rows=3 width=8)
- Hash Key: tenk1.four
- -> Index Scan using tenk1_unique2 on tenk1
(cost=0.16..8.51 rows=3 width=8)
- Index Cond: (unique2 < 10)
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=8.60..8.73 rows=3 width=16)
+ -> Subquery Scan on t (cost=8.60..8.68 rows=1 width=16)
+ Filter: (t.rank_1 < '0.5'::double precision)
+ -> WindowAgg (cost=8.60..8.67 rows=3 width=16)
+ Partition By: tenk1.four
+ Order By: tenk1.ten
+ -> Sort (cost=8.60..8.61 rows=3 width=8)
+ Sort Key: tenk1.four, tenk1.ten
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.16..8.57 rows=3 width=8)
+ Hash Key: tenk1.four
+ -> Index Scan using tenk1_unique2 on tenk1
(cost=0.16..8.51 rows=3 width=8)
+ Index Cond: (unique2 < 10)
Optimizer: Postgres query optimizer
-(12 rows)
+(13 rows)
set optimizer_force_split_window_function to on;
-- worked
@@ -574,38 +575,40 @@ explain SELECT * FROM (SELECT dense_rank() OVER
(PARTITION BY four ORDER BY ten)
-- no worked
explain SELECT * FROM (SELECT cume_dist() OVER (PARTITION BY four ORDER BY
ten) AS rank_1, ten, four FROM tenk1 WHERE unique2 < 10) t WHERE rank_1 <= 1;
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3) (cost=8.60..8.80 rows=10 width=16)
- -> WindowAgg (cost=8.60..8.67 rows=3 width=16)
- Run Condition: (cume_dist() OVER (?) <= '1'::double precision)
- Partition By: tenk1.four
- Order By: tenk1.ten
- -> Sort (cost=8.60..8.61 rows=3 width=8)
- Sort Key: tenk1.four, tenk1.ten
- -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.16..8.57 rows=3 width=8)
- Hash Key: tenk1.four
- -> Index Scan using tenk1_unique2 on tenk1
(cost=0.16..8.51 rows=3 width=8)
- Index Cond: (unique2 < 10)
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=8.60..8.73 rows=3 width=16)
+ -> Subquery Scan on t (cost=8.60..8.68 rows=1 width=16)
+ Filter: (t.rank_1 <= '1'::double precision)
+ -> WindowAgg (cost=8.60..8.67 rows=3 width=16)
+ Partition By: tenk1.four
+ Order By: tenk1.ten
+ -> Sort (cost=8.60..8.61 rows=3 width=8)
+ Sort Key: tenk1.four, tenk1.ten
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.16..8.57 rows=3 width=8)
+ Hash Key: tenk1.four
+ -> Index Scan using tenk1_unique2 on tenk1
(cost=0.16..8.51 rows=3 width=8)
+ Index Cond: (unique2 < 10)
Optimizer: Postgres query optimizer
-(12 rows)
+(13 rows)
explain SELECT * FROM (SELECT percent_rank() OVER (PARTITION BY four ORDER BY
ten) AS rank_1, ten, four FROM tenk1 WHERE unique2 < 10) t WHERE rank_1 < 0.5;
- QUERY PLAN
-----------------------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3) (cost=8.60..8.80 rows=10 width=16)
- -> WindowAgg (cost=8.60..8.67 rows=3 width=16)
- Run Condition: (percent_rank() OVER (?) < '0.5'::double precision)
- Partition By: tenk1.four
- Order By: tenk1.ten
- -> Sort (cost=8.60..8.61 rows=3 width=8)
- Sort Key: tenk1.four, tenk1.ten
- -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.16..8.57 rows=3 width=8)
- Hash Key: tenk1.four
- -> Index Scan using tenk1_unique2 on tenk1
(cost=0.16..8.51 rows=3 width=8)
- Index Cond: (unique2 < 10)
+ QUERY PLAN
+----------------------------------------------------------------------------------------------------------
+ Gather Motion 3:1 (slice1; segments: 3) (cost=8.60..8.73 rows=3 width=16)
+ -> Subquery Scan on t (cost=8.60..8.68 rows=1 width=16)
+ Filter: (t.rank_1 < '0.5'::double precision)
+ -> WindowAgg (cost=8.60..8.67 rows=3 width=16)
+ Partition By: tenk1.four
+ Order By: tenk1.ten
+ -> Sort (cost=8.60..8.61 rows=3 width=8)
+ Sort Key: tenk1.four, tenk1.ten
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
(cost=0.16..8.57 rows=3 width=8)
+ Hash Key: tenk1.four
+ -> Index Scan using tenk1_unique2 on tenk1
(cost=0.16..8.51 rows=3 width=8)
+ Index Cond: (unique2 < 10)
Optimizer: Postgres query optimizer
-(12 rows)
+(13 rows)
explain SELECT * FROM (SELECT rank() OVER (PARTITION BY four ORDER BY ten) AS
rank_1, ten, four FROM tenk1 WHERE unique2 < 10) t WHERE rank_1 > 1;
QUERY PLAN
@@ -3800,17 +3803,24 @@ SELECT
cume_dist() OVER (PARTITION BY depname ORDER BY enroll_date RANGE BETWEEN
CURRENT ROW AND UNBOUNDED FOLLOWING) cd
FROM empsalary;
- QUERY PLAN
-----------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3)
+ QUERY PLAN
+----------------------------------------------------------
+ WindowAgg
+ Partition By: depname
+ Order By: enroll_date
-> WindowAgg
Partition By: depname
Order By: enroll_date
- -> Sort
- Sort Key: depname, enroll_date
- -> Seq Scan on empsalary
+ -> Gather Motion 3:1 (slice1; segments: 3)
+ Merge Key: depname, enroll_date
+ -> WindowAgg
+ Partition By: depname
+ Order By: enroll_date
+ -> Sort
+ Sort Key: depname, enroll_date
+ -> Seq Scan on empsalary
Optimizer: Postgres query optimizer
-(8 rows)
+(15 rows)
-- Ensure WindowFuncs which cannot support their WindowClause's frameOptions
-- being changed are untouched
@@ -3824,14 +3834,15 @@ SELECT
count(*) OVER (PARTITION BY depname ORDER BY enroll_date RANGE BETWEEN
CURRENT ROW AND CURRENT ROW) cnt
FROM empsalary;
- QUERY PLAN
-------------------------------------------------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3)
- Output: empno, depname, (row_number() OVER (?)), (rank() OVER (?)),
(count(*) OVER (?)), enroll_date
- -> WindowAgg
- Output: empno, depname, (row_number() OVER (?)), (rank() OVER (?)),
count(*) OVER (?), enroll_date
- Partition By: empsalary.depname
- Order By: empsalary.enroll_date
+ QUERY PLAN
+------------------------------------------------------------------------------------------------------
+ WindowAgg
+ Output: empno, depname, (row_number() OVER (?)), (rank() OVER (?)),
count(*) OVER (?), enroll_date
+ Partition By: empsalary.depname
+ Order By: empsalary.enroll_date
+ -> Gather Motion 3:1 (slice1; segments: 3)
+ Output: depname, enroll_date, empno, (row_number() OVER (?)), (rank()
OVER (?))
+ Merge Key: depname, enroll_date
-> WindowAgg
Output: depname, enroll_date, empno, row_number() OVER (?),
rank() OVER (?)
Partition By: empsalary.depname
@@ -3843,7 +3854,7 @@ FROM empsalary;
Output: depname, enroll_date, empno
Settings: enable_incremental_sort = 'on'
Optimizer: Postgres query optimizer
-(17 rows)
+(18 rows)
-- Ensure the above query gives us the expected results
SELECT
@@ -3930,8 +3941,8 @@ SELECT * FROM
min(salary) OVER (PARTITION BY depname || 'A', depname) depminsalary
FROM empsalary) emp
WHERE depname = 'sales' OR RANDOM() > 0.5;
- QUERY PLAN
----------------------------------------------------------------------------------------------------------
+ QUERY PLAN
+---------------------------------------------------------------------------------------------------------------------
Subquery Scan on emp
Filter: (((emp.depname)::text = 'sales'::text) OR (random() > '0.5'::double
precision))
-> Gather Motion 3:1 (slice1; segments: 3)
@@ -3940,13 +3951,17 @@ WHERE depname = 'sales' OR RANDOM() > 0.5;
Partition By: empsalary.depname
-> Sort
Sort Key: empsalary.depname
- -> WindowAgg
- Partition By: (((empsalary.depname)::text ||
'A'::text)), empsalary.depname
- -> Sort
- Sort Key: (((empsalary.depname)::text ||
'A'::text)), empsalary.depname
- -> Seq Scan on empsalary
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
+ Hash Key: empsalary.depname
+ -> WindowAgg
+ Partition By: (((empsalary.depname)::text ||
'A'::text)), empsalary.depname
+ -> Sort
+ Sort Key: (((empsalary.depname)::text
|| 'A'::text)), empsalary.depname
+ -> Redistribute Motion 3:3 (slice3;
segments: 3)
+ Hash Key: empsalary.depname,
(((empsalary.depname)::text || 'A'::text))
+ -> Seq Scan on empsalary
Optimizer: Postgres query optimizer
-(14 rows)
+(18 rows)
-- Test window function run conditions are properly pushed down into the
-- WindowAgg
@@ -4346,10 +4361,11 @@ SELECT * FROM
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
Subquery Scan on e
+ Filter: (e.nt < 2)
-> Gather Motion 3:1 (slice1; segments: 3)
Merge Key: (((empsalary.depname)::text || ''::text))
-> WindowAgg
- Filter: (((row_number() OVER (?)) <= 1) AND ((ntile(2) OVER
(?)) < 2))
+ Filter: ((row_number() OVER (?)) <= 1)
Run Condition: (count(1) OVER (?) <= 3)
Partition By: (((empsalary.depname)::text || ''::text))
-> Sort
@@ -4357,7 +4373,7 @@ SELECT * FROM
-> Redistribute Motion 3:3 (slice2; segments: 3)
Hash Key: (((empsalary.depname)::text || ''::text))
-> WindowAgg
- Run Condition: ((row_number() OVER (?) <= 1)
AND (ntile(2) OVER (?) < 2))
+ Run Condition: (row_number() OVER (?) <= 1)
Partition By: empsalary.depname
-> Sort
Sort Key: empsalary.depname
@@ -4371,7 +4387,7 @@ SELECT * FROM
Hash Key:
((''::text || (empsalary.depname)::text))
-> Seq Scan on
empsalary
Optimizer: Postgres query optimizer
-(26 rows)
+(27 rows)
-- Ensure we correctly filter out all of the run conditions from each window
SELECT * FROM
@@ -4632,20 +4648,22 @@ ORDER BY depname, enroll_date;
Group Key: depname, enroll_date, empno, (sum(salary) OVER (?)),
(min(salary) OVER (?))
-> Sort
Sort Key: depname, enroll_date, empno, (sum(salary) OVER (?)),
(min(salary) OVER (?))
- -> WindowAgg
- Partition By: depname
- Order By: enroll_date
- -> Incremental Sort
- Sort Key: depname, enroll_date
- Presorted Key: depname
- -> WindowAgg
- Partition By: depname
- Order By: empno
- -> Sort
- Sort Key: depname, empno
- -> Seq Scan on empsalary
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
+ Hash Key: depname, enroll_date, empno, (sum(salary) OVER
(?)), (min(salary) OVER (?))
+ -> WindowAgg
+ Partition By: depname
+ Order By: enroll_date
+ -> Incremental Sort
+ Sort Key: depname, enroll_date
+ Presorted Key: depname
+ -> WindowAgg
+ Partition By: depname
+ Order By: empno
+ -> Sort
+ Sort Key: depname, empno
+ -> Seq Scan on empsalary
Optimizer: Postgres query optimizer
-(19 rows)
+(21 rows)
-- As above but adjust the ORDER BY clause to help ensure the plan with the
-- minimum amount of sorting wasn't a fluke.
@@ -4666,20 +4684,22 @@ ORDER BY depname, empno;
Group Key: depname, empno, enroll_date, (sum(salary) OVER (?)),
(min(salary) OVER (?))
-> Sort
Sort Key: depname, empno, enroll_date, (sum(salary) OVER (?)),
(min(salary) OVER (?))
- -> WindowAgg
- Partition By: depname
- Order By: empno
- -> Incremental Sort
- Sort Key: depname, empno
- Presorted Key: depname
- -> WindowAgg
- Partition By: depname
- Order By: enroll_date
- -> Sort
- Sort Key: depname, enroll_date
- -> Seq Scan on empsalary
+ -> Redistribute Motion 3:3 (slice2; segments: 3)
+ Hash Key: depname, empno, enroll_date, (sum(salary) OVER
(?)), (min(salary) OVER (?))
+ -> WindowAgg
+ Partition By: depname
+ Order By: empno
+ -> Incremental Sort
+ Sort Key: depname, empno
+ Presorted Key: depname
+ -> WindowAgg
+ Partition By: depname
+ Order By: enroll_date
+ -> Sort
+ Sort Key: depname, enroll_date
+ -> Seq Scan on empsalary
Optimizer: Postgres query optimizer
-(19 rows)
+(21 rows)
RESET enable_hashagg;
-- Test Sort node reordering
@@ -4690,10 +4710,11 @@ SELECT
FROM empsalary;
QUERY PLAN
-------------------------------------------------------------------
- Gather Motion 3:1 (slice1; segments: 3)
- -> WindowAgg
- Partition By: depname
- Order By: salary, enroll_date
+ WindowAgg
+ Partition By: depname
+ Order By: salary, enroll_date
+ -> Gather Motion 3:1 (slice1; segments: 3)
+ Merge Key: depname, salary, enroll_date
-> WindowAgg
Partition By: depname
Order By: salary, enroll_date, empno
@@ -4701,7 +4722,7 @@ FROM empsalary;
Sort Key: depname, salary, enroll_date, empno
-> Seq Scan on empsalary
Optimizer: Postgres query optimizer
-(11 rows)
+(12 rows)
-- Test incremental sorting
EXPLAIN (COSTS OFF)
diff --git a/src/test/regress/sql/bitmap_index.sql
b/src/test/regress/sql/bitmap_index.sql
index f8ebc8267d3..da3f0b9664e 100644
--- a/src/test/regress/sql/bitmap_index.sql
+++ b/src/test/regress/sql/bitmap_index.sql
@@ -310,9 +310,11 @@ SELECT
gp_inject_fault_infinite('finish_prepared_after_record_commit_prepared',
SET client_min_messages='ERROR';
CREATE TABLE trigger_recovery_on_primaries(c int);
RESET client_min_messages;
+SELECT pg_sleep(2);
-- reconnect to the database after restart
\c
SELECT gp_inject_fault('checkpoint', 'reset', dbid) FROM
gp_segment_configuration WHERE role = 'p' AND content > -1;
+SELECT pg_sleep(2);
SELECT gp_inject_fault('finish_prepared_after_record_commit_prepared',
'reset', dbid) FROM gp_segment_configuration WHERE role = 'p' AND content > -1;
SET enable_seqscan=off;
SET enable_indexscan=off;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]