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 <[email protected]>
Reviewed-by: Bharath Rupireddy <[email protected]>
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(-)

Reply via email to