pgsql: postgres_fdw: Fix flaky push down FUNCTION RTE test

From: Alexander Korotkov <akorotkov(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: postgres_fdw: Fix flaky push down FUNCTION RTE test
Date: 2026-08-24 16:05:14
Message-ID: E1wyXAf-00000001vL8-1h1b@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

postgres_fdw: Fix flaky push down FUNCTION RTE test

The unnest() test introduced in 0ee83dd4a99 did not produce a
deterministic EXPLAIN plan output.

The two sides of this test's nested loop join cost about the same, so
which one ended up as the outer wasn't stable and could flip between
platforms.

Use an equality predicate on ft1.c3 instead of a range one. That
restricts ft1 to a single row, so it's clearly the outer of the nested
loop and the Materialize on the inner side goes away, giving a stable
plan.

Author: Sami Imseih <samimseih(at)gmail(dot)com>
Reviewed-by: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAA5RZ0uC%3DGOihOKcF7o3JVETF3e-Fkc4OUO5NbqMEKCTeSN-dQ%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0fd1609afe255b275c2560db6db584081a16e8a0

Modified Files
--------------
contrib/postgres_fdw/expected/postgres_fdw.out | 24 +++++++++++-------------
contrib/postgres_fdw/sql/postgres_fdw.sql | 8 ++++----
2 files changed, 15 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2026-08-24 18:57:14 pgsql: Add C test function for pg_locale.h APIs.
Previous Message Peter Eisentraut 2026-08-24 12:31:28 pgsql: Fix untranslatable message that was pasted together at run time