Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fcjUZ-0004eX-Af for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jul 2018 03:39:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fcjUW-0006O2-3O for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Jul 2018 03:39:04 +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.89) (envelope-from ) id 1fcjUV-0006Nv-T8 for pgsql-hackers@lists.postgresql.org; Tue, 10 Jul 2018 03:39:03 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fcjUR-0006ou-Qe for pgsql-hackers@postgresql.org; Tue, 10 Jul 2018 03:39:03 +0000 Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w6A3cu3S009234; Tue, 10 Jul 2018 12:38:56 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 11824638861; Tue, 10 Jul 2018 12:38:56 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 06480638849; Tue, 10 Jul 2018 12:38:56 +0900 (JST) Received: from [IPv6:::1] (unknown [129.60.241.75]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 0214D400755; Tue, 10 Jul 2018 12:38:56 +0900 (JST) Message-ID: <5B442A40.2040903@lab.ntt.co.jp> Date: Tue, 10 Jul 2018 12:38:40 +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: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled. References: <5AFD6580.5090308@lab.ntt.co.jp> <5AFE81CC.8000508@lab.ntt.co.jp> <5B17C5EC.1090602@lab.ntt.co.jp> <5B1E5071.1000704@lab.ntt.co.jp> <5B23A964.9020800@lab.ntt.co.jp> <5B28FB19.3090809@lab.ntt.co.jp> <5B362B38.2000103@lab.ntt.co.jp> <5B3CB833.4040005@lab.ntt.co.jp> <5B3F4BAA.3050601@lab.ntt.co.jp> <5B4340E9.3030707@lab.ntt.co.jp> <5B434886.9010107@lab.ntt.co.jp> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CC-Mail-RelayStamp: 1 To: Ashutosh Bapat Cc: Rajkumar Raghuwanshi , pgsql-hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk (2018/07/09 20:43), Ashutosh Bapat wrote: >> >> I don't have any numbers right now, so that is nothing but a concern. But as >> I said in a previous email, in the approach I proposed, we don't need to >> spend extra cycles where partitioning is not involved. I think that is a >> good thing in itself. No? > > At the cost of having targetlist being type inconsistent. I don't have > any testcase either to show that that's a problem in practice. So, > it's a trade-off of a concern vs concern. As I said before, I don't see any issue in having such a targetlist, but I might be missing something, so I'd like to discuss a bit more about that. Could you tell me the logic/place in the PG code where you think the problem might occur. (IIRC, you mentioned something about that before (pathkeys? or index-only scans?), but sorry, I don't understand that.) > Apart from that, in your approach there are extra cycles spent in > traversing the targetlist to add ConvertRowtypeExpr, albeit only when > there is a whole-row expression in the targetlist, when creating > plans. That's not there in my patch. Right. That's unfortunate, but I think that that would be still better than needing to spent extra cycles where partitioning is not involved. And ISTM that the traversing cost is not that large compared to the cost we pay before that for query planning for a partitionwise join. Best regards, Etsuro Fujita