@@ -15,7 +15,7 @@ drivername :DB_DRIVERNAME,
15
15
url :DB_URL,
16
16
querytimeout '10',
17
17
jarfile :DB_DRIVERPATH,
18
- maxheapsize '6000 '
18
+ maxheapsize '600 '
19
19
);
20
20
--Testcase 3:
21
21
CREATE USER MAPPING FOR public SERVER :DB_SERVERNAME OPTIONS(username :DB_USER,password :DB_PASS);
@@ -105,16 +105,20 @@ SELECT avg(a) AS avg_32 FROM aggtest WHERE a < 100;
105
105
-- Round the result to 3 digits to avoid platform-specific results.
106
106
--Testcase 14:
107
107
EXPLAIN VERBOSE SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
108
- QUERY PLAN
109
- -------------------------------------------------------------
108
+ QUERY PLAN
109
+ -------------------------------------------------
110
110
Foreign Scan (cost=1.00..1.00 rows=1 width=16)
111
- Output: ((avg(b))::numeric(10,3) )
112
- Remote SQL: SELECT "numeric"( avg(b), 655367 ) FROM aggtest
111
+ Output: ((avg(b))) ::numeric(10,3)
112
+ Remote SQL: SELECT avg(b) FROM aggtest
113
113
(3 rows)
114
114
115
115
--Testcase 15:
116
116
SELECT avg(b)::numeric(10,3) AS avg_107_943 FROM aggtest;
117
- psql:sql/13.4/aggregates.sql:80: ERROR: remote server returned an error
117
+ avg_107_943
118
+ -------------
119
+ 107.943
120
+ (1 row)
121
+
118
122
--Testcase 16:
119
123
EXPLAIN VERBOSE SELECT sum(four) AS sum_1500 FROM onek;
120
124
QUERY PLAN
@@ -213,14 +217,12 @@ SELECT max(aggtest.b) AS max_324_78 FROM aggtest;
213
217
214
218
--Testcase 28:
215
219
EXPLAIN VERBOSE SELECT stddev_pop(b) FROM aggtest;
216
- QUERY PLAN
217
- -------------------------------------------------------------------------------
218
- Aggregate (cost=205.06..205.07 rows=1 width=8)
219
- Output: stddev_pop(b)
220
- -> Foreign Scan on public.aggtest (cost=100.00..197.75 rows=2925 width=4)
221
- Output: id, a, b
222
- Remote SQL: SELECT b FROM aggtest
223
- (5 rows)
220
+ QUERY PLAN
221
+ -------------------------------------------------
222
+ Foreign Scan (cost=1.00..1.00 rows=1 width=8)
223
+ Output: (stddev_pop(b))
224
+ Remote SQL: SELECT stddev_pop(b) FROM aggtest
225
+ (3 rows)
224
226
225
227
--Testcase 29:
226
228
SELECT stddev_pop(b) FROM aggtest;
@@ -231,14 +233,12 @@ SELECT stddev_pop(b) FROM aggtest;
231
233
232
234
--Testcase 30:
233
235
EXPLAIN VERBOSE SELECT stddev_samp(b) FROM aggtest;
234
- QUERY PLAN
235
- -------------------------------------------------------------------------------
236
- Aggregate (cost=205.06..205.07 rows=1 width=8)
237
- Output: stddev_samp(b)
238
- -> Foreign Scan on public.aggtest (cost=100.00..197.75 rows=2925 width=4)
239
- Output: id, a, b
240
- Remote SQL: SELECT b FROM aggtest
241
- (5 rows)
236
+ QUERY PLAN
237
+ --------------------------------------------------
238
+ Foreign Scan (cost=1.00..1.00 rows=1 width=8)
239
+ Output: (stddev_samp(b))
240
+ Remote SQL: SELECT stddev_samp(b) FROM aggtest
241
+ (3 rows)
242
242
243
243
--Testcase 31:
244
244
SELECT stddev_samp(b) FROM aggtest;
@@ -249,14 +249,12 @@ SELECT stddev_samp(b) FROM aggtest;
249
249
250
250
--Testcase 32:
251
251
EXPLAIN VERBOSE SELECT var_pop(b) FROM aggtest;
252
- QUERY PLAN
253
- -------------------------------------------------------------------------------
254
- Aggregate (cost=205.06..205.07 rows=1 width=8)
255
- Output: var_pop(b)
256
- -> Foreign Scan on public.aggtest (cost=100.00..197.75 rows=2925 width=4)
257
- Output: id, a, b
258
- Remote SQL: SELECT b FROM aggtest
259
- (5 rows)
252
+ QUERY PLAN
253
+ ------------------------------------------------
254
+ Foreign Scan (cost=1.00..1.00 rows=1 width=8)
255
+ Output: (var_pop(b))
256
+ Remote SQL: SELECT var_pop(b) FROM aggtest
257
+ (3 rows)
260
258
261
259
--Testcase 33:
262
260
SELECT var_pop(b) FROM aggtest;
@@ -267,14 +265,12 @@ SELECT var_pop(b) FROM aggtest;
267
265
268
266
--Testcase 34:
269
267
EXPLAIN VERBOSE SELECT var_samp(b) FROM aggtest;
270
- QUERY PLAN
271
- -------------------------------------------------------------------------------
272
- Aggregate (cost=205.06..205.07 rows=1 width=8)
273
- Output: var_samp(b)
274
- -> Foreign Scan on public.aggtest (cost=100.00..197.75 rows=2925 width=4)
275
- Output: id, a, b
276
- Remote SQL: SELECT b FROM aggtest
277
- (5 rows)
268
+ QUERY PLAN
269
+ ------------------------------------------------
270
+ Foreign Scan (cost=1.00..1.00 rows=1 width=8)
271
+ Output: (var_samp(b))
272
+ Remote SQL: SELECT var_samp(b) FROM aggtest
273
+ (3 rows)
278
274
279
275
--Testcase 35:
280
276
SELECT var_samp(b) FROM aggtest;
@@ -593,14 +589,12 @@ DROP FOREIGN TABLE regr_test;
593
589
-- test count, distinct
594
590
--Testcase 72:
595
591
EXPLAIN VERBOSE SELECT count(four) AS cnt_1000 FROM onek;
596
- QUERY PLAN
597
- -------------------------------------------------------------------------------------------------------------------------------------------------------
598
- Aggregate (cost=205.06..205.07 rows=1 width=8)
599
- Output: count(four)
600
- -> Foreign Scan on public.onek (cost=100.00..197.75 rows=2925 width=4)
601
- Output: unique1, unique2, two, four, ten, twenty, hundred, thousand, twothousand, fivethous, tenthous, odd, even, stringu1, stringu2, string4
602
- Remote SQL: SELECT four FROM onek
603
- (5 rows)
592
+ QUERY PLAN
593
+ ------------------------------------------------
594
+ Foreign Scan (cost=1.00..1.00 rows=1 width=8)
595
+ Output: (count(four))
596
+ Remote SQL: SELECT count(four) FROM onek
597
+ (3 rows)
604
598
605
599
--Testcase 73:
606
600
SELECT count(four) AS cnt_1000 FROM onek;
@@ -652,9 +646,14 @@ from tenk1 o;
652
646
(13 rows)
653
647
654
648
--Testcase 77:
655
- -- select
656
- -- (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
657
- -- from tenk1 o;
649
+ select
650
+ (select max((select i.unique2 from tenk1 i where i.unique1 = o.unique1)))
651
+ from tenk1 o;
652
+ max
653
+ ------
654
+ 9999
655
+ (1 row)
656
+
658
657
--
659
658
-- test boolean aggregates
660
659
--
@@ -873,15 +872,10 @@ select distinct max(unique2) from tenk1;
873
872
--Testcase 99:
874
873
explain (costs off)
875
874
select max(100) from tenk1;
876
- QUERY PLAN
877
- ----------------------------------------------------
878
- Result
879
- InitPlan 1 (returns $0)
880
- -> Limit
881
- -> Result
882
- One-Time Filter: (100 IS NOT NULL)
883
- -> Foreign Scan on tenk1
884
- (6 rows)
875
+ QUERY PLAN
876
+ --------------
877
+ Foreign Scan
878
+ (1 row)
885
879
886
880
--Testcase 100:
887
881
select max(100) from tenk1;
0 commit comments