Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Tom Lane
Abbas Butt writes: > Postgres_fdw optimizes remote queries by pushing down the where clause. > This feature does not work consistently when the query is executed from > within a pl/pgsql function. The optimization works when the function > executes the query for the first 5 times, and fails afterw

Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Abbas Butt
Sorry for the confusion. ANALYZE works for the foreign table 'foreign_numbers'. test=# analyze foreign_numbers; ANALYZE test=# On Tue, Jan 31, 2017 at 5:04 AM, Ashutosh Bapat < ashutosh.ba...@enterprisedb.com> wrote: > On Tue, Jan 31, 2017 at 5:23 PM, Abbas Butt > wrote: > > > > > > On Tue, Ja

Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Ashutosh Bapat
On Tue, Jan 31, 2017 at 5:23 PM, Abbas Butt wrote: > > > On Tue, Jan 31, 2017 at 3:15 AM, Etsuro Fujita > wrote: >> >> On 2017/01/31 19:53, Abbas Butt wrote: >>> >>> On Tue, Jan 31, 2017 at 2:25 AM, Etsuro Fujita >>> mailto:fujita.ets...@lab.ntt.co.jp>> wrote: >>> On 2017/01/31 18:24, Abbas B

Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Abbas Butt
On Tue, Jan 31, 2017 at 3:15 AM, Etsuro Fujita wrote: > On 2017/01/31 19:53, Abbas Butt wrote: > >> On Tue, Jan 31, 2017 at 2:25 AM, Etsuro Fujita >> mailto:fujita.ets...@lab.ntt.co.jp>> wrote: >> On 2017/01/31 18:24, Abbas Butt wrote: >> > > Postgres_fdw optimizes remote queries by p

Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Etsuro Fujita
On 2017/01/31 19:53, Abbas Butt wrote: On Tue, Jan 31, 2017 at 2:25 AM, Etsuro Fujita mailto:fujita.ets...@lab.ntt.co.jp>> wrote: On 2017/01/31 18:24, Abbas Butt wrote: Postgres_fdw optimizes remote queries by pushing down the where clause. This feature does not wor

Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Abbas Butt
On Tue, Jan 31, 2017 at 2:25 AM, Etsuro Fujita wrote: > On 2017/01/31 18:24, Abbas Butt wrote: > >> Postgres_fdw optimizes remote queries by pushing down the where clause. >> This feature does not work consistently when the query is executed from >> within a pl/pgsql function. The optimization wo

Re: [HACKERS] An issue in remote query optimization

2017-01-31 Thread Etsuro Fujita
On 2017/01/31 18:24, Abbas Butt wrote: Postgres_fdw optimizes remote queries by pushing down the where clause. This feature does not work consistently when the query is executed from within a pl/pgsql function. The optimization works when the function executes the query for the first 5 times, and

[HACKERS] An issue in remote query optimization

2017-01-31 Thread Abbas Butt
Hi, Postgres_fdw optimizes remote queries by pushing down the where clause. This feature does not work consistently when the query is executed from within a pl/pgsql function. The optimization works when the function executes the query for the first 5 times, and fails afterwards. Example: Step 1: