Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0U1w-0005V7-A0 for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Oct 2017 14:55:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1e0U1v-0005Fu-0k for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Oct 2017 14:55:11 +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 1e0U1C-0003tN-TW for pgsql-bugs@postgresql.org; Fri, 06 Oct 2017 14:54:26 +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 1e0U19-0008JN-Vy for pgsql-bugs@postgresql.org; Fri, 06 Oct 2017 14:54:26 +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 v96EsLUX006470; Fri, 6 Oct 2017 10:54:21 -0400 From: Tom Lane To: fabriziomello@gmail.com cc: josef.machytka@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> Comments: In-reply-to =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= message dated "Fri, 06 Oct 2017 10:29:29 -0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6468.1507301661.1@sss.pgh.pa.us> Date: Fri, 06 Oct 2017 10:54:21 -0400 Message-ID: <6469.1507301661@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 =?UTF-8?Q?Fabr=C3=ADzio_de_Royes_Mello?= 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs