Stabilize ordering and accept plan in domain test
authorTomas Vondra <tomas@2ndquadrant.com>
Sat, 15 Jul 2017 00:02:07 +0000 (02:02 +0200)
committerTomas Vondra <tomas@2ndquadrant.com>
Sat, 15 Jul 2017 00:02:07 +0000 (02:02 +0200)
Trivial result ordering stabilization by adding ORDER BY clause, and
accepting explain output with additional Remote Subquery node (on top
of the upstream plan).

src/test/regress/expected/domain.out
src/test/regress/sql/domain.sql

index ac204c9eca5c8d6005327c1cc044ffeab7295e47..409c28d764a61ea2bacf60bf5e035dcfc6e55f6c 100644 (file)
@@ -115,8 +115,8 @@ select * from domarrtest order by 1, 2;
  {2,2}         | {{a,b},{c,d},{e,f}}
  {2,2}         | {{a},{c}}
  {{2,2},{2,2}} | {{a,b}}
-               | {{a,b,c},{d,e,f}}
  {11,NULL,22}  | 
+               | {{a,b,c},{d,e,f}}
 (6 rows)
 
 select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
@@ -125,9 +125,9 @@ select testint4arr[1], testchar4arr[2:2] from domarrtest order by 1, 2;
            2 | {{c}}
            2 | {{c,d}}
            2 | {{c,d}}
+          11 | 
              | {}
              | {{d,e,f}}
-          11 | 
 (6 rows)
 
 select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order by 1, 2;
@@ -137,8 +137,8 @@ select array_dims(testint4arr), array_dims(testchar4arr) from domarrtest order b
  [1:2]      | [1:2][1:2]
  [1:2]      | [1:3][1:2]
  [1:2][1:2] | [1:1][1:2]
-            | [1:2][1:3]
  [1:3]      | 
+            | [1:2][1:3]
 (6 rows)
 
 COPY domarrtest FROM stdin;
@@ -162,7 +162,7 @@ update domarrtest set
   testint4arr[1] = testint4arr[1] + 1,
   testint4arr[3] = testint4arr[3] - 1
 where testchar4arr is null;
-select * from domarrtest where testchar4arr is null;
+select * from domarrtest where testchar4arr is null order by 1;
    testint4arr    | testchar4arr 
 ------------------+--------------
  {12,NULL,21}     | 
@@ -284,13 +284,14 @@ select * from dcomptable;
 explain (verbose, costs off)
   update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
     where d1[1].i > 0;
-                                                   QUERY PLAN                                                   
-----------------------------------------------------------------------------------------------------------------
- Update on public.dcomptable
-   ->  Seq Scan on public.dcomptable
-         Output: (d1[1].r := (d1[1].r - '1'::double precision))[1].i := (d1[1].i + '1'::double precision), ctid
-         Filter: (dcomptable.d1[1].i > '0'::double precision)
-(4 rows)
+                                                        QUERY PLAN                                                        
+--------------------------------------------------------------------------------------------------------------------------
+ Remote Subquery Scan on any (datanode_1,datanode_2)
+   ->  Update on public.dcomptable
+         ->  Seq Scan on public.dcomptable
+               Output: (d1[1].r := (d1[1].r - '1'::double precision))[1].i := (d1[1].i + '1'::double precision), d1, ctid
+               Filter: (dcomptable.d1[1].i > '0'::double precision)
+(5 rows)
 
 create rule silly as on delete to dcomptable do instead
   update dcomptable set d1[1].r = d1[1].r - 1, d1[1].i = d1[1].i + 1
@@ -306,6 +307,8 @@ Rules:
     silly AS
     ON DELETE TO dcomptable DO INSTEAD  UPDATE dcomptable SET d1[1].r = dcomptable.d1[1].r - 1::double precision, d1[1].i = dcomptable.d1[1].i + 1::double precision
   WHERE dcomptable.d1[1].i > 0::double precision
+Distribute By: REPLICATION
+Location Nodes: ALL DATANODES
 
 drop table dcomptable;
 drop type comptype cascade;
index 01d447c342623fd341a9e7cfacb19e284347a0dd..825655ff732a402b6c1088063c454e2440b5aca9 100644 (file)
@@ -106,7 +106,7 @@ update domarrtest set
   testint4arr[3] = testint4arr[3] - 1
 where testchar4arr is null;
 
-select * from domarrtest where testchar4arr is null;
+select * from domarrtest where testchar4arr is null order by 1;
 
 drop table domarrtest;
 drop domain domainint4arr restrict;