From 7204f35919b7e021e8d1bc9f2d76fd6bfcdd2070 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 20 May 2024 15:08:30 -0400 Subject: Revert commit 66c0185a3 and follow-on patches. This reverts 66c0185a3 (Allow planner to use Merge Append to efficiently implement UNION) as well as the follow-on commits d5d2205c8, 3b1a7eb28, 7487044d6. In addition to those, 07746a8ef had to be removed then re-applied in a different place, because 66c0185a3 moved the relevant code. The reason for this last-minute thrashing is that depesz found a case in which the patched code creates a completely wrong plan that silently gives incorrect query results. It's unclear what the cause is or how many cases are affected, but with beta1 wrap staring us in the face, there's no time for closer investigation. After we figure that out, we can decide whether to un-revert this for beta2 or hold it for v18. Discussion: https://postgr.es/m/Zktzf926vslR35Fv@depesz.com (also some private discussion among pgsql-release) --- contrib/postgres_fdw/expected/postgres_fdw.out | 7 ------- contrib/postgres_fdw/sql/postgres_fdw.sql | 9 --------- 2 files changed, 16 deletions(-) (limited to 'contrib/postgres_fdw') diff --git a/contrib/postgres_fdw/expected/postgres_fdw.out b/contrib/postgres_fdw/expected/postgres_fdw.out index 078b8a966f8..9ae36d3059d 100644 --- a/contrib/postgres_fdw/expected/postgres_fdw.out +++ b/contrib/postgres_fdw/expected/postgres_fdw.out @@ -11511,10 +11511,6 @@ DROP INDEX base_tbl1_idx; DROP INDEX base_tbl2_idx; DROP INDEX async_p3_idx; -- UNION queries -SET enable_sort TO off; -SET enable_incremental_sort TO off; --- Adjust fdw_startup_cost so that we get an unordered path in the Append. -ALTER SERVER loopback2 OPTIONS (ADD fdw_startup_cost '0.00'); EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO result_tbl (SELECT a, b, 'AAA' || c FROM async_p1 ORDER BY a LIMIT 10) @@ -11596,9 +11592,6 @@ SELECT * FROM result_tbl ORDER BY a; (12 rows) DELETE FROM result_tbl; -RESET enable_incremental_sort; -RESET enable_sort; -ALTER SERVER loopback2 OPTIONS (DROP fdw_startup_cost); -- Disable async execution if we use gating Result nodes for pseudoconstant -- quals EXPLAIN (VERBOSE, COSTS OFF) diff --git a/contrib/postgres_fdw/sql/postgres_fdw.sql b/contrib/postgres_fdw/sql/postgres_fdw.sql index 09ba234e43d..1f31ac14df0 100644 --- a/contrib/postgres_fdw/sql/postgres_fdw.sql +++ b/contrib/postgres_fdw/sql/postgres_fdw.sql @@ -3885,11 +3885,6 @@ DROP INDEX base_tbl2_idx; DROP INDEX async_p3_idx; -- UNION queries -SET enable_sort TO off; -SET enable_incremental_sort TO off; --- Adjust fdw_startup_cost so that we get an unordered path in the Append. -ALTER SERVER loopback2 OPTIONS (ADD fdw_startup_cost '0.00'); - EXPLAIN (VERBOSE, COSTS OFF) INSERT INTO result_tbl (SELECT a, b, 'AAA' || c FROM async_p1 ORDER BY a LIMIT 10) @@ -3916,10 +3911,6 @@ UNION ALL SELECT * FROM result_tbl ORDER BY a; DELETE FROM result_tbl; -RESET enable_incremental_sort; -RESET enable_sort; -ALTER SERVER loopback2 OPTIONS (DROP fdw_startup_cost); - -- Disable async execution if we use gating Result nodes for pseudoconstant -- quals EXPLAIN (VERBOSE, COSTS OFF) -- cgit v1.2.3