Re: BUG #14845: postgres_fdw and mysql_fdw can cause crash of instance

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: fabriziomello(at)gmail(dot)com
Cc: josef(dot)machytka(at)gmail(dot)com, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14845: postgres_fdw and mysql_fdw can cause crash of instance
Date: 2017-10-06 14:54:21
Message-ID: 6469.1507301661@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= <fabriziomello(at)gmail(dot)com> writes:
>> I work from time to time with postgres_fdw and mysql_fdw and they both seem
>> to have the same problem - they use too much memory if I query huge remote
>> tables.

> Would be nice if you can provide to us a reproducible test case, so we can
> try to figure out what's happen...

Indeed. I can't say about mysql_fdw, but postgres_fdw is only supposed to
fetch 100 rows at a time (cf fetch_size option), so it shouldn't run out
of memory just because the amount of data to be fetched is large.

One idea is that, because the planner lacks information about the remote
table, it picks some stupid plan that ends up blowing out memory. In that
case, perhaps turning on use_remote_estimate would help. But we're just
guessing here due to lack of useful detail.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2017-10-06 15:07:28 Re: postgresql-10.0/src/bin/psql/mainloop.c:465: suspicious condition ?
Previous Message Tom Lane 2017-10-06 14:48:51 Re: BUG #14844: Failure/Duplicate key value with ALTER DATABASE set search_path