Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0W0w-0007YW-RZ for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Oct 2017 17:02:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e0W0w-0005S7-7a for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Oct 2017 17:02:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e0W0D-00047C-JI for pgsql-bugs@postgresql.org; Fri, 06 Oct 2017 17:01:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1e0W08-0002ee-LL for pgsql-bugs@postgresql.org; Fri, 06 Oct 2017 17:01:31 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v96H1QPp009949; Fri, 6 Oct 2017 13:01:26 -0400 From: Tom Lane To: Josef Machytka cc: fabriziomello@gmail.com, pgsql-bugs@postgresql.org Subject: Re: BUG #14845: postgres_fdw and mysql_fdw can cause crash of instance In-reply-to: References: <20171006112426.14640.55619@wrigleys.postgresql.org> <6469.1507301661@sss.pgh.pa.us> Comments: In-reply-to Josef Machytka message dated "Fri, 06 Oct 2017 17:42:08 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <9947.1507309286.1@sss.pgh.pa.us> Date: Fri, 06 Oct 2017 13:01:26 -0400 Message-ID: <9948.1507309286@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Josef Machytka 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs