forked from huawei/openGauss-server
flip to native Makefile, and update upsert_subquery test case output
This commit is contained in:
parent
3fe0cec7ce
commit
77cf5be8eb
|
|
@ -12,7 +12,7 @@
|
||||||
# Example: ./build_opengauss.sh -3rd /path/to/your/third_party_binarylibs/
|
# Example: ./build_opengauss.sh -3rd /path/to/your/third_party_binarylibs/
|
||||||
|
|
||||||
# change it to "N", if you want to build with original build system based on solely Makefiles
|
# change it to "N", if you want to build with original build system based on solely Makefiles
|
||||||
CMAKE_PKG="Y"
|
CMAKE_PKG="N"
|
||||||
|
|
||||||
#(0) pre-check
|
#(0) pre-check
|
||||||
if [ ! -f opengauss.spec ] || [ ! -f package_internal.sh ]; then
|
if [ ! -f opengauss.spec ] || [ ! -f package_internal.sh ]; then
|
||||||
|
|
|
||||||
|
|
@ -539,21 +539,19 @@ explain (costs off, verbose) select count(*) from hh;
|
||||||
|
|
||||||
insert into aa values(3,3,3,3) on duplicate key update a2 = (select count(*) from hh); -- suc
|
insert into aa values(3,3,3,3) on duplicate key update a2 = (select count(*) from hh); -- suc
|
||||||
explain (costs off, verbose) insert into aa values(3,3,3,3) on duplicate key update a2 = (select count(*) from hh); -- subquery is not execute by smp, but there still is a two-level agg.
|
explain (costs off, verbose) insert into aa values(3,3,3,3) on duplicate key update a2 = (select count(*) from hh); -- subquery is not execute by smp, but there still is a two-level agg.
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
---------------------------------------------------
|
------------------------------------------------
|
||||||
Insert on upserttest.aa
|
Insert on upserttest.aa
|
||||||
Conflict Resolution: UPDATE
|
Conflict Resolution: UPDATE
|
||||||
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
||||||
InitPlan 1 (returns $0)
|
InitPlan 1 (returns $0)
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: pg_catalog.count(*)
|
Output: count(*)
|
||||||
-> Aggregate
|
-> Seq Scan on upserttest.hh
|
||||||
Output: count(*)
|
Output: hh.h1, hh.h2, hh.h3
|
||||||
-> Seq Scan on upserttest.hh
|
|
||||||
Output: hh.h1, hh.h2, hh.h3
|
|
||||||
-> Result
|
-> Result
|
||||||
Output: 3, 3, 3, 3
|
Output: 3, 3, 3, 3
|
||||||
(12 rows)
|
(10 rows)
|
||||||
|
|
||||||
explain (costs off, verbose) select 4,count(*), 4, 4 from hh; -- should be a smp query
|
explain (costs off, verbose) select 4,count(*), 4, 4 from hh; -- should be a smp query
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
|
|
@ -577,11 +575,9 @@ explain (costs off, verbose) insert into aa select 4,count(*), 4, 4 from hh on d
|
||||||
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
||||||
InitPlan 1 (returns $0)
|
InitPlan 1 (returns $0)
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: pg_catalog.count(*)
|
Output: count(*)
|
||||||
-> Aggregate
|
-> Seq Scan on upserttest.hh
|
||||||
Output: count(*)
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
-> Seq Scan on upserttest.hh
|
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
|
||||||
-> Subquery Scan on "*SELECT*"
|
-> Subquery Scan on "*SELECT*"
|
||||||
Output: "*SELECT*"."?column?", "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
Output: "*SELECT*"."?column?", "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
|
|
@ -592,25 +588,23 @@ explain (costs off, verbose) insert into aa select 4,count(*), 4, 4 from hh on d
|
||||||
Output: 4, count(*)
|
Output: 4, count(*)
|
||||||
-> Seq Scan on upserttest.hh
|
-> Seq Scan on upserttest.hh
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
(20 rows)
|
(18 rows)
|
||||||
|
|
||||||
prepare sub4 as insert into aa select $1, count(*), 4, 4 from hh on duplicate key update a2 =(select count(*) + $1 from hh);
|
prepare sub4 as insert into aa select $1, count(*), 4, 4 from hh on duplicate key update a2 =(select count(*) + $1 from hh);
|
||||||
execute sub4(1); -- suc
|
execute sub4(1); -- suc
|
||||||
explain (costs off, verbose) execute sub4(1); -- insert-part is a smp plan, but update-part not
|
explain (costs off, verbose) execute sub4(1); -- insert-part is a smp plan, but update-part not
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
----------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------
|
||||||
Insert on upserttest.aa
|
Insert on upserttest.aa
|
||||||
Conflict Resolution: UPDATE
|
Conflict Resolution: UPDATE
|
||||||
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
||||||
InitPlan 1 (returns $0)
|
InitPlan 1 (returns $0)
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: (pg_catalog.count(*) + 1)
|
Output: (count(*) + 1)
|
||||||
-> Aggregate
|
-> Seq Scan on upserttest.hh
|
||||||
Output: count(*)
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
-> Seq Scan on upserttest.hh
|
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
|
||||||
-> Subquery Scan on "*SELECT*"
|
-> Subquery Scan on "*SELECT*"
|
||||||
Output: 1, "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
Output: "*SELECT*"."?column?", "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: (1), pg_catalog.count(*), (4), (4)
|
Output: (1), pg_catalog.count(*), (4), (4)
|
||||||
-> Streaming(type: BROADCAST dop: 1/2)
|
-> Streaming(type: BROADCAST dop: 1/2)
|
||||||
|
|
@ -619,7 +613,7 @@ explain (costs off, verbose) execute sub4(1);
|
||||||
Output: 1, count(*), 4
|
Output: 1, count(*), 4
|
||||||
-> Seq Scan on upserttest.hh
|
-> Seq Scan on upserttest.hh
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
(20 rows)
|
(18 rows)
|
||||||
|
|
||||||
set query_dop = 1;
|
set query_dop = 1;
|
||||||
select * from aa order by a1;
|
select * from aa order by a1;
|
||||||
|
|
@ -633,8 +627,8 @@ select * from aa order by a1;
|
||||||
|
|
||||||
execute sub4(2); -- suc
|
execute sub4(2); -- suc
|
||||||
explain (costs off, verbose) execute sub4(2); -- the plan was rebuilt, not a smp any more.
|
explain (costs off, verbose) execute sub4(2); -- the plan was rebuilt, not a smp any more.
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-----------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------
|
||||||
Insert on upserttest.aa
|
Insert on upserttest.aa
|
||||||
Conflict Resolution: UPDATE
|
Conflict Resolution: UPDATE
|
||||||
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
||||||
|
|
@ -644,7 +638,7 @@ explain (costs off, verbose) execute sub4(2);
|
||||||
-> Seq Scan on upserttest.hh
|
-> Seq Scan on upserttest.hh
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
-> Subquery Scan on "*SELECT*"
|
-> Subquery Scan on "*SELECT*"
|
||||||
Output: 2, "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
Output: "*SELECT*"."?column?", "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: 2, count(*), 4, 4
|
Output: 2, count(*), 4, 4
|
||||||
-> Seq Scan on upserttest.hh
|
-> Seq Scan on upserttest.hh
|
||||||
|
|
@ -887,13 +881,13 @@ set query_dop = 2;
|
||||||
prepare sub5 as insert into aa select $1, count(*), 4, 4 from hh on duplicate key update a2 =(select count(*) * excluded.a1 + $1 from hh);
|
prepare sub5 as insert into aa select $1, count(*), 4, 4 from hh on duplicate key update a2 =(select count(*) * excluded.a1 + $1 from hh);
|
||||||
execute sub5(1); -- suc
|
execute sub5(1); -- suc
|
||||||
explain (costs off, verbose) execute sub5(1); -- insert-part is a smp plan, but update-part not
|
explain (costs off, verbose) execute sub5(1); -- insert-part is a smp plan, but update-part not
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
----------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------
|
||||||
Insert on upserttest.aa
|
Insert on upserttest.aa
|
||||||
Conflict Resolution: UPDATE
|
Conflict Resolution: UPDATE
|
||||||
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
||||||
-> Subquery Scan on "*SELECT*"
|
-> Subquery Scan on "*SELECT*"
|
||||||
Output: 1, "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
Output: "*SELECT*"."?column?", "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: (1), pg_catalog.count(*), (4), (4)
|
Output: (1), pg_catalog.count(*), (4), (4)
|
||||||
-> Streaming(type: BROADCAST dop: 1/2)
|
-> Streaming(type: BROADCAST dop: 1/2)
|
||||||
|
|
@ -904,23 +898,21 @@ explain (costs off, verbose) execute sub5(1);
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
SubPlan 1
|
SubPlan 1
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: ((pg_catalog.count(*) * "excluded".a1) + 1)
|
Output: ((count(*) * "excluded".a1) + 1)
|
||||||
-> Aggregate
|
-> Seq Scan on upserttest.hh
|
||||||
Output: count(*)
|
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
||||||
-> Seq Scan on upserttest.hh
|
(18 rows)
|
||||||
Output: upserttest.hh.h1, upserttest.hh.h2, upserttest.hh.h3
|
|
||||||
(20 rows)
|
|
||||||
|
|
||||||
set query_dop = 1;
|
set query_dop = 1;
|
||||||
execute sub5(2); -- suc
|
execute sub5(2); -- suc
|
||||||
explain (costs off, verbose) execute sub5(2); -- the plan was rebuilt, not a smp any more.
|
explain (costs off, verbose) execute sub5(2); -- the plan was rebuilt, not a smp any more.
|
||||||
QUERY PLAN
|
QUERY PLAN
|
||||||
-----------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------
|
||||||
Insert on upserttest.aa
|
Insert on upserttest.aa
|
||||||
Conflict Resolution: UPDATE
|
Conflict Resolution: UPDATE
|
||||||
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
Conflict Arbiter Indexes: aa_pkey, aa_a4_key
|
||||||
-> Subquery Scan on "*SELECT*"
|
-> Subquery Scan on "*SELECT*"
|
||||||
Output: 2, "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
Output: "*SELECT*"."?column?", "*SELECT*".count, "*SELECT*"."?column?", "*SELECT*"."?column?"
|
||||||
-> Aggregate
|
-> Aggregate
|
||||||
Output: 2, count(*), 4, 4
|
Output: 2, count(*), 4, 4
|
||||||
-> Seq Scan on upserttest.hh
|
-> Seq Scan on upserttest.hh
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue