Re: Wrong cost estimation for foreign tables join with use_remote_estimate disabled

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Wrong cost estimation for foreign tables join with use_remote_estimate disabled
Date: 2018-06-21 17:08:45
Message-ID: 18984.1529600925@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru> writes:
> The following very simple test reduce the problem with wrong cost
> estimation:
> create foreign table t1_fdw(x integer, y integer) server pg_fdw options
> (table_name 't1', use_remote_estimate 'false');
> create foreign table t2_fdw(x integer) server pg_fdw options (table_name
> 't2', use_remote_estimate 'false');

> It is possible to force Postgres to use correct plan by setting
> "fdw_startup_cost" to some very large value (100000000 for example).
> ...
> Also correct plan is used when use_remote_estimate is true.

If you are unhappy about the results with use_remote_estimate off, don't
run it that way. The optimizer does not have a crystal ball.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nico Williams 2018-06-21 17:12:40 Re: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Andrew Dunstan 2018-06-21 17:02:55 Re: Fast default stuff versus pg_upgrade