aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorEtsuro Fujita <efujita@postgresql.org>2019-01-29 12:27:13 +0900
committerEtsuro Fujita <efujita@postgresql.org>2019-01-29 12:27:13 +0900
commit449d0a85507b07be3040df78a93e2966ed0908c8 (patch)
treef3c4e0d247e6e77cee17852809fabbb9bf9b0950 /contrib/postgres_fdw/postgres_fdw.c
parente0c2933a767c652429ddef674622b4656fa43092 (diff)
downloadpostgresql-449d0a85507b07be3040df78a93e2966ed0908c8.tar.gz
postgresql-449d0a85507b07be3040df78a93e2966ed0908c8.zip
postgres_fdw: Fix test for cached costs in estimate_path_cost_size().
estimate_path_cost_size() failed to re-use cached costs when the cached startup/total cost was 0, so it calculated the costs redundantly. This is an oversight in commit aa09cd242f; but apply the patch to HEAD only because there are no reports of actual trouble from that. Author: Etsuro Fujita Discussion: https://postgr.es/m/5C4AF3F3.4060409%40lab.ntt.co.jp
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c
index 9244fe7571f..1a88919cfca 100644
--- a/contrib/postgres_fdw/postgres_fdw.c
+++ b/contrib/postgres_fdw/postgres_fdw.c
@@ -2625,7 +2625,7 @@ estimate_path_cost_size(PlannerInfo *root,
* bare scan each time. Instead, use the costs if we have cached them
* already.
*/
- if (fpinfo->rel_startup_cost > 0 && fpinfo->rel_total_cost > 0)
+ if (fpinfo->rel_startup_cost >= 0 && fpinfo->rel_total_cost >= 0)
{
startup_cost = fpinfo->rel_startup_cost;
run_cost = fpinfo->rel_total_cost - fpinfo->rel_startup_cost;