Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4f90fe1

Browse files
author
Alexander Korotkov
committed
Strange FDW plan change.
1 parent fc73814 commit 4f90fe1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2781,16 +2781,17 @@ select c2, sum(c1) from ft2 group by c2 having avg(c1) < 500 and sum(c1) < 49800
27812781
-- Unshippable HAVING clause will be evaluated locally, and other qual in HAVING clause is pushed down
27822782
explain (verbose, costs off)
27832783
select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having (avg(c1) / avg(c1)) * random() <= 1 and avg(c1) < 500) x;
2784-
QUERY PLAN
2785-
---------------------------------------------------------------------------------------------------------------------------------------
2784+
QUERY PLAN
2785+
---------------------------------------------------------------------------------------------------------------------------------------------
27862786
Aggregate
27872787
Output: count(*)
2788-
-> Foreign Scan
2789-
Output: ft1.c5, NULL::bigint, (sqrt((ft1.c2)::double precision))
2790-
Filter: (((((avg(ft1.c1)) / (avg(ft1.c1))))::double precision * random()) <= '1'::double precision)
2791-
Relations: Aggregate on (public.ft1)
2792-
Remote SQL: SELECT c5, NULL::bigint, sqrt(c2), avg("C 1") FROM "S 1"."T 1" GROUP BY 1, 3 HAVING ((avg("C 1") < 500::numeric))
2793-
(7 rows)
2788+
-> Subquery Scan on x
2789+
-> Foreign Scan
2790+
Output: ft1.c5, NULL::bigint, (sqrt((ft1.c2)::double precision))
2791+
Filter: (((((avg(ft1.c1)) / (avg(ft1.c1))))::double precision * random()) <= '1'::double precision)
2792+
Relations: Aggregate on (public.ft1)
2793+
Remote SQL: SELECT c5, NULL::bigint, sqrt(c2), avg("C 1") FROM "S 1"."T 1" GROUP BY 1, 3 HAVING ((avg("C 1") < 500::numeric))
2794+
(8 rows)
27942795

27952796
select count(*) from (select c5, count(c1) from ft1 group by c5, sqrt(c2) having (avg(c1) / avg(c1)) * random() <= 1 and avg(c1) < 500) x;
27962797
count

0 commit comments

Comments
 (0)