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: Josef Machytka <josef(dot)machytka(at)gmail(dot)com>
Cc: fabriziomello(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 17:01:26
Message-ID: 9948.1507309286@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Josef Machytka <josef(dot)machytka(at)gmail(dot)com> writes:
> In this case which went wrong I used postgres_fdw to compare data on local
> and remote database using "select all from remote except select all from
> local".

I think my theory B probably applies then: without use_remote_estimate,
the planner would not guess that the remote table is huge, and that could
well allow it to pick a hashed EXCEPT implementation --- which will then
try to collect the entire remote table into an in-memory hash table.

I don't know whether mysql_fdw has a comparable switch, but in any case
if it wasn't turned on then the same failure mode could apply to that FDW.

I wonder if we should rethink the default setting of use_remote_estimate
being "off". Particularly as we keep on allowing postgres_fdw to consider
more different plan types, it seems like the potential for stupid plan
choices is getting worse all the time.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2017-10-06 18:01:43 Re: BUG #14843: CREATE TABLE churns through all memory, crashes db
Previous Message Hans Buschmann 2017-10-06 16:50:31 Re: BUG #14844: Failure/Duplicate key value with ALTER DATABASE set search_path