Skip to content

Commit 594b715

Browse files
fix regress expected errors
1 parent d8272a5 commit 594b715

File tree

10 files changed

+115
-188
lines changed

10 files changed

+115
-188
lines changed

src/test/regress/expected/create_view.out

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -38,55 +38,6 @@ SELECT * FROM viewtest ORDER BY a;
3838

3939
CREATE OR REPLACE VIEW viewtest AS
4040
SELECT a, b FROM viewtest_tbl WHERE a > 5 ORDER BY b DESC;
41-
EXPLAIN SELECT * FROM viewtest;
42-
QUERY PLAN
43-
-------------------------------------------------------------------------------------------
44-
Remote Subquery Scan on all (datanode_1,datanode_2) (cost=22.23..22.79 rows=225 width=8)
45-
-> Sort (cost=22.23..22.79 rows=225 width=8)
46-
Sort Key: viewtest_tbl.b DESC
47-
-> Seq Scan on viewtest_tbl (cost=0.00..13.44 rows=225 width=8)
48-
Filter: (a > 5)
49-
(5 rows)
50-
51-
SELECT * FROM viewtest;
52-
a | b
53-
----+----
54-
20 | 25
55-
15 | 20
56-
10 | 15
57-
(3 rows)
58-
59-
EXPLAIN SELECT a FROM viewtest;
60-
QUERY PLAN
61-
-------------------------------------------------------------------------------------------------
62-
Subquery Scan on viewtest (cost=22.23..27.29 rows=225 width=4)
63-
-> Remote Subquery Scan on all (datanode_1,datanode_2) (cost=22.23..22.79 rows=225 width=8)
64-
-> Sort (cost=22.23..22.79 rows=225 width=8)
65-
Sort Key: viewtest_tbl.b DESC
66-
-> Seq Scan on viewtest_tbl (cost=0.00..13.44 rows=225 width=8)
67-
Filter: (a > 5)
68-
(6 rows)
69-
70-
SELECT a FROM viewtest;
71-
a
72-
----
73-
20
74-
15
75-
10
76-
(3 rows)
77-
78-
EXPLAIN SELECT * FROM viewtest ORDER BY a;
79-
QUERY PLAN
80-
-------------------------------------------------------------------------------------------
81-
Remote Subquery Scan on all (datanode_1,datanode_2) (cost=36.08..36.64 rows=225 width=8)
82-
-> Sort (cost=36.08..36.64 rows=225 width=8)
83-
Sort Key: viewtest_tbl.a
84-
-> Sort (cost=22.23..22.79 rows=225 width=8)
85-
Sort Key: viewtest_tbl.b DESC
86-
-> Seq Scan on viewtest_tbl (cost=0.00..13.44 rows=225 width=8)
87-
Filter: (a > 5)
88-
(7 rows)
89-
9041
SELECT * FROM viewtest ORDER BY a;
9142
a | b
9243
----+----

src/test/regress/expected/join_3.out

Lines changed: 42 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,33 +1867,6 @@ SELECT '' AS "xxx", *
18671867
| 1 | 4 | one | -1
18681868
(1 row)
18691869

1870-
--
1871-
-- semijoin selectivity for <>
1872-
--
1873-
explain (costs off)
1874-
select * from int4_tbl i4, tenk1 a
1875-
where exists(select * from tenk1 b
1876-
where a.twothousand = b.twothousand and a.fivethous <> b.fivethous)
1877-
and i4.f1 = a.tenthous;
1878-
QUERY PLAN
1879-
-----------------------------------------------------------------------
1880-
Remote Subquery Scan on all (datanode_1,datanode_2)
1881-
-> Hash Semi Join
1882-
Hash Cond: (a.twothousand = b.twothousand)
1883-
Join Filter: (a.fivethous <> b.fivethous)
1884-
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1885-
Distribute results by H: twothousand
1886-
-> Hash Join
1887-
Hash Cond: (a.tenthous = i4.f1)
1888-
-> Seq Scan on tenk1 a
1889-
-> Hash
1890-
-> Seq Scan on int4_tbl i4
1891-
-> Hash
1892-
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1893-
Distribute results by H: twothousand
1894-
-> Seq Scan on tenk1 b
1895-
(15 rows)
1896-
18971870
--
18981871
-- More complicated constructs
18991872
--
@@ -2447,7 +2420,7 @@ select count(*) from tenk1 a, tenk1 b
24472420
-> Partial Aggregate
24482421
-> Hash Join
24492422
Hash Cond: (a.hundred = b.thousand)
2450-
-> Seq Scan on tenk1 a
2423+
-> Index Only Scan using tenk1_hundred on tenk1 a
24512424
-> Hash
24522425
-> Remote Subquery Scan on all (datanode_1,datanode_2)
24532426
-> Seq Scan on tenk1 b
@@ -3318,7 +3291,7 @@ select count(*) from
33183291
Join Filter: (a.unique2 = b.unique1)
33193292
-> Remote Subquery Scan on all
33203293
Distribute results by H: thousand
3321-
-> Seq Scan on tenk1 c
3294+
-> Index Only Scan using tenk1_thous_tenthous on tenk1 c
33223295
-> Hash
33233296
-> Remote Subquery Scan on all
33243297
Distribute results by H: thousand
@@ -3363,7 +3336,7 @@ select b.unique1 from
33633336
Join Filter: (b.unique1 = 42)
33643337
-> Remote Subquery Scan on all
33653338
Distribute results by H: 42
3366-
-> Seq Scan on tenk1 c
3339+
-> Index Only Scan using tenk1_thous_tenthous on tenk1 c
33673340
-> Hash
33683341
-> Remote Subquery Scan on all
33693342
Distribute results by H: unique1
@@ -3468,17 +3441,19 @@ select f1, unique2, case when unique2 is null then f1 else 0 end
34683441
QUERY PLAN
34693442
--------------------------------------------------------------------------
34703443
Remote Subquery Scan on all
3471-
-> Hash Right Join
3472-
Hash Cond: (b.unique2 = a.f1)
3444+
-> Merge Right Join
3445+
Merge Cond: (b.unique2 = a.f1)
34733446
Filter: (CASE WHEN (b.unique2 IS NULL) THEN a.f1 ELSE 0 END = 0)
34743447
-> Remote Subquery Scan on all
34753448
Distribute results by H: unique2
3476-
-> Seq Scan on tenk1 b
3477-
-> Hash
3449+
-> Index Only Scan using tenk1_unique2 on tenk1 b
3450+
-> Materialize
34783451
-> Remote Subquery Scan on all
34793452
Distribute results by H: f1
3480-
-> Seq Scan on int4_tbl a
3481-
(11 rows)
3453+
-> Sort
3454+
Sort Key: a.f1
3455+
-> Seq Scan on int4_tbl a
3456+
(13 rows)
34823457

34833458
select f1, unique2, case when unique2 is null then f1 else 0 end
34843459
from int4_tbl a left join tenk1 b on f1 = unique2
@@ -3537,33 +3512,37 @@ left join
35373512
using (join_key)
35383513
) foo3
35393514
using (join_key);
3540-
QUERY PLAN
3541-
-----------------------------------------------------------------------
3515+
QUERY PLAN
3516+
--------------------------------------------------------------------------------
35423517
Hash Right Join
35433518
Output: "*VALUES*".column1, i1.f1, (666)
35443519
Hash Cond: (i1.f1 = "*VALUES*".column1)
35453520
-> Remote Subquery Scan on all (datanode_1,datanode_2)
35463521
Output: i1.f1, 666
3547-
-> Hash Right Join
3522+
-> Merge Right Join
35483523
Output: i1.f1, 666
3549-
Hash Cond: (i2.unique2 = i1.f1)
3524+
Merge Cond: (i2.unique2 = i1.f1)
35503525
-> Remote Subquery Scan on all (datanode_1,datanode_2)
35513526
Output: i2.unique2
35523527
Distribute results by H: unique2
3553-
-> Seq Scan on public.tenk1 i2
3528+
Sort Key: i2.unique2
3529+
-> Index Only Scan using tenk1_unique2 on public.tenk1 i2
35543530
Output: i2.unique2
3555-
-> Hash
3531+
-> Materialize
35563532
Output: i1.f1
35573533
-> Remote Subquery Scan on all (datanode_1)
35583534
Output: i1.f1
35593535
Distribute results by H: f1
3560-
-> Seq Scan on public.int4_tbl i1
3536+
-> Sort
35613537
Output: i1.f1
3538+
Sort Key: i1.f1
3539+
-> Seq Scan on public.int4_tbl i1
3540+
Output: i1.f1
35623541
-> Hash
35633542
Output: "*VALUES*".column1
35643543
-> Values Scan on "*VALUES*"
35653544
Output: "*VALUES*".column1
3566-
(24 rows)
3545+
(28 rows)
35673546

35683547
select foo1.join_key as foo1_id, foo3.join_key AS foo3_id, bug_field from
35693548
(values (0),(1)) foo1(join_key)
@@ -4720,19 +4699,18 @@ select * from generate_series(100,200) g,
47204699
explain (num_nodes off, nodes off, costs off)
47214700
select count(*) from tenk1 a,
47224701
tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
4723-
QUERY PLAN
4724-
------------------------------------------------------------
4702+
QUERY PLAN
4703+
------------------------------------------------------------------------------
47254704
Finalize Aggregate
47264705
-> Remote Subquery Scan on all
47274706
-> Partial Aggregate
4728-
-> Hash Join
4729-
Hash Cond: (b.unique2 = a.unique1)
4730-
-> Remote Subquery Scan on all
4731-
Distribute results by H: unique2
4732-
-> Seq Scan on tenk1 b
4733-
-> Hash
4734-
-> Seq Scan on tenk1 a
4735-
(10 rows)
4707+
-> Merge Join
4708+
Merge Cond: (b.unique2 = a.unique1)
4709+
-> Remote Subquery Scan on all
4710+
Distribute results by H: unique2
4711+
-> Index Only Scan using tenk1_unique2 on tenk1 b
4712+
-> Index Only Scan using tenk1_unique1 on tenk1 a
4713+
(9 rows)
47364714

47374715
select count(*) from tenk1 a,
47384716
tenk1 b join lateral (values(a.unique1)) ss(x) on b.unique2 = ss.x;
@@ -4745,18 +4723,18 @@ select count(*) from tenk1 a,
47454723
explain (num_nodes off, nodes off, costs off)
47464724
select count(*) from tenk1 a,
47474725
tenk1 b join lateral (values(a.unique1),(-1)) ss(x) on b.unique2 = ss.x;
4748-
QUERY PLAN
4749-
-----------------------------------------------------
4726+
QUERY PLAN
4727+
------------------------------------------------------------------------
47504728
Aggregate
47514729
-> Hash Join
47524730
Hash Cond: ("*VALUES*".column1 = b.unique2)
47534731
-> Nested Loop
47544732
-> Remote Subquery Scan on all
4755-
-> Seq Scan on tenk1 a
4733+
-> Index Only Scan using tenk1_unique1 on tenk1 a
47564734
-> Values Scan on "*VALUES*"
47574735
-> Hash
47584736
-> Remote Subquery Scan on all
4759-
-> Seq Scan on tenk1 b
4737+
-> Index Only Scan using tenk1_unique2 on tenk1 b
47604738
(10 rows)
47614739

47624740
select count(*) from tenk1 a,
@@ -6085,8 +6063,8 @@ from onek t1, tenk1 t2
60856063
where exists (select 1 from tenk1 t3
60866064
where t3.thousand = t1.unique1 and t3.tenthous = t2.hundred)
60876065
and t1.unique1 < 1;
6088-
QUERY PLAN
6089-
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
6066+
QUERY PLAN
6067+
---------------------------------------------------------------------------------------------------------
60906068
Remote Subquery Scan on all (datanode_1,datanode_2)
60916069
Output: t1.unique1, t2.hundred
60926070
-> Nested Loop
@@ -6101,13 +6079,13 @@ where exists (select 1 from tenk1 t3
61016079
Output: t3.thousand, t3.tenthous
61026080
Group Key: t3.thousand, t3.tenthous
61036081
-> Remote Subquery Scan on all (datanode_1,datanode_2)
6104-
Output: t3.unique1, t3.unique2, t3.two, t3.four, t3.ten, t3.twenty, t3.hundred, t3.thousand, t3.twothousand, t3.fivethous, t3.tenthous, t3.odd, t3.even, t3.stringu1, t3.stringu2, t3.string4
6082+
Output: t3.thousand, t3.tenthous
61056083
Distribute results by H: thousand
61066084
-> HashAggregate
6107-
Output: t3.unique1, t3.unique2, t3.two, t3.four, t3.ten, t3.twenty, t3.hundred, t3.thousand, t3.twothousand, t3.fivethous, t3.tenthous, t3.odd, t3.even, t3.stringu1, t3.stringu2, t3.string4
6085+
Output: t3.thousand, t3.tenthous
61086086
Group Key: t3.thousand, t3.tenthous
6109-
-> Seq Scan on public.tenk1 t3
6110-
Output: t3.unique1, t3.unique2, t3.two, t3.four, t3.ten, t3.twenty, t3.hundred, t3.thousand, t3.twothousand, t3.fivethous, t3.tenthous, t3.odd, t3.even, t3.stringu1, t3.stringu2, t3.string4
6087+
-> Index Only Scan using tenk1_thous_tenthous on public.tenk1 t3
6088+
Output: t3.thousand, t3.tenthous
61116089
-> Hash
61126090
Output: t1.unique1
61136091
-> Remote Subquery Scan on all (datanode_1,datanode_2)

src/test/regress/expected/rules.out

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,9 +2397,6 @@ toyemp| SELECT emp.name,
23972397
emp.location,
23982398
(12 * emp.salary) AS annualsal
23992399
FROM emp;
2400-
zv1| SELECT zt1.f1,
2401-
'dummy'::text AS junk
2402-
FROM pg_temp_17.zt1;
24032400
SELECT tablename, rulename, definition FROM pg_rules
24042401
ORDER BY tablename, rulename;
24052402
pg_settings|pg_settings_n|CREATE RULE pg_settings_n AS

src/test/regress/expected/select_parallel_4.out

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ select length(stringu1) from tenk1 group by length(stringu1);
8181

8282
explain (costs off)
8383
select stringu1, count(*) from tenk1 group by stringu1 order by stringu1;
84-
QUERY PLAN
84+
QUERY PLAN
8585
-----------------------------------------------------------
8686
Finalize GroupAggregate
87-
Group Key: stringu1
88-
-> Remote Subquery Scan on all (datanode_1,datanode_2)
87+
Group Key: stringu1
88+
-> Remote Subquery Scan on all (datanode_1,datanode_2)
8989
-> Sort
9090
Sort Key: stringu1
91-
-> Partial HashAggregate
92-
Group Key: stringu1
91+
-> Partial HashAggregate
92+
Group Key: stringu1
9393
-> Gather
9494
Workers Planned: 4
9595
-> Parallel Seq Scan on tenk1
@@ -98,7 +98,7 @@ explain (costs off)
9898
explain (costs off)
9999
select count(stringu1) as num, (CASE WHEN length(stringu1) > 5 THEN 'LONG' ELSE 'SHORT' END) as islong
100100
from tenk1 group by islong order by num;
101-
QUERY PLAN
101+
QUERY PLAN
102102
--------------------------------------------------------------------------------------------------------------------
103103
Sort
104104
Sort Key: (count(stringu1))
@@ -107,8 +107,8 @@ explain (costs off)
107107
-> Remote Subquery Scan on all (datanode_1,datanode_2)
108108
-> Partial HashAggregate
109109
Group Key: (CASE WHEN (length((stringu1)::text) > 5) THEN 'LONG'::text ELSE 'SHORT'::text END)
110-
-> Gather
111-
Workers Planned: 4
110+
-> Gather
111+
Workers Planned: 4
112112
-> Parallel Seq Scan on tenk1
113113
(10 rows)
114114

src/test/regress/expected/subselect.out

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ select * from int4_tbl where
877877
SubPlan 1
878878
-> Remote Subquery Scan on all (datanode_1,datanode_2)
879879
Output: a.unique1
880-
-> Seq Scan on public.tenk1 a
880+
-> Index Only Scan using tenk1_unique1 on public.tenk1 a
881881
Output: a.unique1
882882
(26 rows)
883883

@@ -1173,7 +1173,7 @@ set enable_nestloop to true;
11731173
set enable_hashjoin to false;
11741174
set enable_mergejoin to false;
11751175
explain select a.a,(select b.a from tbl_b b where b.a = a.a) q from tbl_a a order by 1,2;
1176-
QUERY PLAN
1176+
QUERY PLAN
11771177
-----------------------------------------------------------------------------------------------
11781178
Remote Subquery Scan on all (datanode_1,datanode_2) (cost=3923.54..3924.39 rows=338 width=8)
11791179
-> Sort (cost=3923.54..3924.39 rows=338 width=8)
@@ -1710,7 +1710,7 @@ select a.a,(select b.a from tbl_b b where b.a = a.a limit 1) q from tbl_a a orde
17101710

17111711
-- support pullup lateral ANY_SUBLINK
17121712
explain select * from tbl_a a where a.b IN (select b.a from tbl_b b where b.b > a.b);
1713-
QUERY PLAN
1713+
QUERY PLAN
17141714
---------------------------------------------------------------------------------------------------------
17151715
Remote Subquery Scan on all (datanode_1,datanode_2) (cost=120.19..145.13 rows=112 width=8)
17161716
-> Hash Semi Join (cost=120.19..145.13 rows=112 width=8)
@@ -1749,31 +1749,31 @@ where t2.a = (
17491749
where
17501750
t1.a = t2.a
17511751
);
1752-
QUERY PLAN
1752+
QUERY PLAN
17531753
-----------------------------------------------------------------------------------------------------------
17541754
Hash Join
17551755
Hash Cond: (t2.a = "EXPR_subquery".min)
17561756
-> Remote Subquery Scan on all (datanode_1,datanode_2)
17571757
-> Seq Scan on sub_t2 t2
17581758
-> Hash
1759-
-> Hash Left Join
1760-
Hash Cond: (t1.a = "EXPR_subquery".a)
1761-
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1762-
-> Seq Scan on sub_t1 t1
1763-
-> Hash
1764-
-> Subquery Scan on "EXPR_subquery"
1765-
-> HashAggregate
1766-
Group Key: t2_1.a
1767-
-> Nested Loop
1759+
-> Hash Left Join
1760+
Hash Cond: (t1.a = "EXPR_subquery".a)
1761+
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1762+
-> Seq Scan on sub_t1 t1
1763+
-> Hash
1764+
-> Subquery Scan on "EXPR_subquery"
1765+
-> HashAggregate
1766+
Group Key: t2_1.a
17681767
-> Nested Loop
1769-
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1770-
-> Seq Scan on sub_t2 t2_1
1768+
-> Nested Loop
1769+
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1770+
-> Seq Scan on sub_t2 t2_1
1771+
-> Materialize
1772+
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1773+
-> Seq Scan on sub_interfere1
17711774
-> Materialize
17721775
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1773-
-> Seq Scan on sub_interfere1
1774-
-> Materialize
1775-
-> Remote Subquery Scan on all (datanode_1,datanode_2)
1776-
-> Seq Scan on sub_interfere2
1776+
-> Seq Scan on sub_interfere2
17771777
(23 rows)
17781778

17791779
DROP TABLE sub_t1;

0 commit comments

Comments
 (0)