summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAshutosh Bapat2011-06-21 06:49:07 +0000
committerAshutosh Bapat2011-06-21 06:49:07 +0000
commit2a828017d88ff64453b37771337646454316269c (patch)
tree7d0df0817c89fc69ae413e5a8d53bc153dd6917a /src/test
parent88a19b42f3b599927b74e0aef2e19b9161b3a7eb (diff)
The patch has following changes:
1. Any query with aggregates in it, is planned through standard planner, instead of directly creating a RemoteQuery node for it in pgxc_planner(). Before this fix, any query which involved aggregates and no grouping clause, was directly converted into a RemoteQuery node. RemoteQuery had no mechanism to handle aggregates involved in expressions properly (3237756). It could only handle aggregates without any covering node. Also, aggregates with order by clause would cause aggregates grouped according to datanodes storing the rows (3237712, 3147936). With the fix, such queries are planned through standard planner and optimized in grouping_planner to push the aggregates and/or group by clauses to the datanodes. This change made the aggregation mechanism under RemoteQuery node unnecessary. Hence cleaned up the same. 2. If there are any qualifications in the query, which need to be evaluated on the coordinator only, those are considered as local quals and are stuck in RemoteQuery node. There was no mechanism to handle these quals in ExecRemoteQuery(). Added that mechanism. 3. Fixed a bug in create_remotegrouping_planner() - When the RemoteQuery node has quals in it, (i.e. there are local quals), we can not push the aggregates and GROUP BY clause to the data node, because before aggregating, we need to apply those scan clauses, which can happen only on coordinator. 4. There are couple of expected output changes, related to the explain verbose (in create_index test). The patch fixes bugs 3237712, 3147936 and 3237756.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/create_index_1.out90
1 files changed, 54 insertions, 36 deletions
diff --git a/src/test/regress/expected/create_index_1.out b/src/test/regress/expected/create_index_1.out
index ab3807cb4c..67d3939e2e 100644
--- a/src/test/regress/expected/create_index_1.out
+++ b/src/test/regress/expected/create_index_1.out
@@ -244,10 +244,12 @@ LINE 1: SELECT count(*) FROM gcircle_tbl WHERE f1 && '<(500,500),500...
^
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)';
count
@@ -257,10 +259,12 @@ SELECT count(*) FROM point_tbl WHERE f1 <@ box '(0,0,100,100)';
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1;
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1;
count
@@ -270,10 +274,12 @@ SELECT count(*) FROM point_tbl WHERE box '(0,0,100,100)' @> f1;
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,50),(100,0),(0,0)';
count
@@ -283,10 +289,12 @@ SELECT count(*) FROM point_tbl WHERE f1 <@ polygon '(0,0),(0,100),(100,100),(50,
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>';
count
@@ -296,10 +304,12 @@ SELECT count(*) FROM point_tbl WHERE f1 <@ circle '<(50,50),50>';
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)';
count
@@ -309,10 +319,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 << '(0.0, 0.0)';
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
count
@@ -322,10 +334,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >> '(0.0, 0.0)';
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
count
@@ -335,10 +349,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 <^ '(0.0, 0.0)';
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
count
@@ -348,10 +364,12 @@ SELECT count(*) FROM point_tbl p WHERE p.f1 >^ '(0.0, 0.0)';
EXPLAIN (COSTS OFF)
SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)';
- QUERY PLAN
----------------------------------
- Data Node Scan (Node Count [1])
-(1 row)
+ QUERY PLAN
+---------------------------------------------
+ Aggregate
+ -> Materialize
+ -> Data Node Scan (Node Count [1])
+(3 rows)
SELECT count(*) FROM point_tbl p WHERE p.f1 ~= '(-5, -12)';
count