Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Tq9-0000IQ-Tb for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Apr 2018 10:15:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5Tq8-0000zZ-Ni for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Apr 2018 10:15:56 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f5Tq8-0000zP-DA for pgsql-hackers@lists.postgresql.org; Mon, 09 Apr 2018 10:15:56 +0000 Received: from tama50.ecl.ntt.co.jp ([129.60.39.147]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f5Tq5-0003hD-6e for pgsql-hackers@postgresql.org; Mon, 09 Apr 2018 10:15:54 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w39AFjbq024165; Mon, 9 Apr 2018 19:15:45 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 9728DEA84BC; Mon, 9 Apr 2018 19:15:45 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 8CA5EEA844A; Mon, 9 Apr 2018 19:15:45 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 7B17C4007C6; Mon, 9 Apr 2018 19:15:45 +0900 (JST) Message-ID: <5ACB3D40.4040304@lab.ntt.co.jp> Date: Mon, 09 Apr 2018 19:15:28 +0900 From: Etsuro Fujita User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 Subject: Re: postgres_fdw: perform UPDATE/DELETE .. RETURNING on a join directly References: <23783.1519929258@sss.pgh.pa.us> <5A9928F1.2010206@lab.ntt.co.jp> <21358.1520229112@sss.pgh.pa.us> <25502.1520277552@sss.pgh.pa.us> <857d2c90-492a-028e-37b9-66d86d8!cd5dc@joeconway.com> <22164.1520287630@sss.pgh.pa.us> <20180406191747.4dwggard7beyfkps@alap3.anarazel.de> In-Reply-To: <20180406191747.4dwggard7beyfkps@alap3.anarazel.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Andres Freund Cc: Tom Lane , Joe Conway , Ashutosh Bapat , Robert Haas , Pg Hackers , Rushabh Lathia , Michael Paquier X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2018/04/07 4:17), Andres Freund wrote: > On 2018-03-05 17:07:10 -0500, Tom Lane wrote: >> Meanwhile, I'm back to wondering what could possibly have affected >> the planner's estimates, if pg_proc and pg_statistic didn't change. >> I confess bafflement ... but we've now eliminated the autovacuum- >> did-it theory entirely, so it's time to start looking someplace else. >> I wonder if something in the postgres_fdw remote join machinery >> is not as deterministic as it should be. > > I wonder if temporarily changing postgres_fdw's test to specify an extra > config that installs auto_explain in full aggressiveness (i.e. including > costs etc) and enables debug3 logging could help narrow this down? +1 because we cannot deny the possibility that the plan instability is caused by such an unexpected behavior of postgres_fdw. Best regards, Etsuro Fujita