You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cac169d adjusted DEFAULT_FDW_TUPLE_COST and that seems to have caused
a test to become unstable on 32-bit machines.
4b14e18 tried to fix this as originally the plan was flipping between
a Nested Loop and Hash Join. That commit forced the Nested Loop, but
there's still flexibility to push or not push the sort to the remote
server and 32-bit seems to prefer to push and on 64-bit, the costs
prefer not to.
Here let's just turn off enable_sort to significantly encourage the sort
to take place on the remote server.
Reported-by: Michael Paquier, Richard Guo
Discussion: https://postgr.es/m/[email protected]
Copy file name to clipboardExpand all lines: contrib/postgres_fdw/expected/postgres_fdw.out
+14-15Lines changed: 14 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -4019,27 +4019,25 @@ EXECUTE st1(101, 101);
4019
4019
(1 row)
4020
4020
4021
4021
SET enable_hashjoin TO off;
4022
+
SET enable_sort TO off;
4022
4023
-- subquery using stable function (can't be sent to remote)
4023
4024
PREPARE st2(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c4) = '1970-01-17'::date) ORDER BY c1;
Remote SQL: SELECT "C 1", c2, c3, c4, c5, c6, c7, c8 FROM "S 1"."T 1" WHERE (("C 1" < 20)) ORDER BY "C 1" ASC NULLS LAST
4034
+
-> Materialize
4035
+
Output: t2.c3
4036
+
-> Foreign Scan on public.ft2 t2
4037
4037
Output: t2.c3
4038
-
-> Foreign Scan on public.ft2 t2
4039
-
Output: t2.c3
4040
-
Filter: (date(t2.c4) = '01-17-1970'::date)
4041
-
Remote SQL: SELECT c3, c4 FROM "S 1"."T 1" WHERE (("C 1" > 10))
4042
-
(15 rows)
4038
+
Filter: (date(t2.c4) = '01-17-1970'::date)
4039
+
Remote SQL: SELECT c3, c4 FROM "S 1"."T 1" WHERE (("C 1" > 10))
4040
+
(12 rows)
4043
4041
4044
4042
EXECUTE st2(10, 20);
4045
4043
c1 | c2 | c3 | c4 | c5 | c6 | c7 | c8
@@ -4054,6 +4052,7 @@ EXECUTE st2(101, 121);
4054
4052
(1 row)
4055
4053
4056
4054
RESET enable_hashjoin;
4055
+
RESET enable_sort;
4057
4056
-- subquery using immutable function (can be sent to remote)
4058
4057
PREPARE st3(int) AS SELECT * FROM ft1 t1 WHERE t1.c1 < $2 AND t1.c3 IN (SELECT c3 FROM ft2 t2 WHERE c1 > $1 AND date(c5) = '1970-01-17'::date) ORDER BY c1;
0 commit comments