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

2018-06-22 Thread Konstantin Knizhnik
On 22.06.2018 13:30, Ashutosh Bapat wrote: On Fri, Jun 22, 2018 at 11:56 AM, Konstantin Knizhnik wrote: On 21.06.2018 20:08, Tom Lane wrote: Konstantin Knizhnik writes: The following very simple test reduce the problem with wrong cost estimation: create foreign table t1_fdw(x integer, y

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

2018-06-22 Thread Ashutosh Bapat
Sorry here's preview link [1] [1] https://ashutoshpg.blogspot.com/b/post-preview?token=TCTIKGQBAAA.2iKpIUItkwZLkXiujvs0zad-DtDdKbwIdRFCGbac9--XbqcA-xnCdz4wmbD4hIaEHuyg5Xrz8eZq8ZNmw83yfQ.HXi__guM-7SzdIWi27QkjA&postId=4019325618679658571&type=POST On Fri, Jun 22, 2018 at 4:00 PM, Ashutosh Bapat w

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

2018-06-22 Thread Ashutosh Bapat
On Fri, Jun 22, 2018 at 11:56 AM, Konstantin Knizhnik wrote: > > > On 21.06.2018 20:08, Tom Lane wrote: >> >> Konstantin Knizhnik 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 o

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

2018-06-22 Thread Etsuro Fujita
(2018/06/22 18:49), Amit Langote wrote: On 2018/06/22 18:15, Etsuro Fujita wrote: I'd vote for #2. One idea for that is to introduce CREATE FOREIGN INDEX to have information on remote indexes on the local side, which I proposed before. I have been putting it on hold since then, though. Sorry

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

2018-06-22 Thread Amit Langote
On 2018/06/22 18:15, Etsuro Fujita wrote: > I'd vote for #2.  One idea for that is to introduce CREATE FOREIGN INDEX > to have information on remote indexes on the local side, which I proposed > before.  I have been putting it on hold since then, though. Sorry to hijack this thread, but I'd like t

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

2018-06-22 Thread Etsuro Fujita
Hi Konstantin, (2018/06/22 15:26), Konstantin Knizhnik wrote: On 21.06.2018 20:08, Tom Lane wrote: Konstantin Knizhnik 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'

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

2018-06-21 Thread Konstantin Knizhnik
On 21.06.2018 20:08, Tom Lane wrote: Konstantin Knizhnik 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

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

2018-06-21 Thread Tom Lane
Konstantin Knizhnik 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

Wrong cost estimation for foreign tables join with use_remote_estimate disabled

2018-06-21 Thread Konstantin Knizhnik
Hi hackers, I hope that somebody understand postgres_fdw cost calculation magic better than I;) The following very simple test reduce the problem with wrong cost estimation: create table t1(x integer primary key, y integer); create index on t1(y); insert into t1 values (generate_series(1,100