Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1go2AO-0000AB-K3 for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Jan 2019 08:21:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1go2AN-0002HZ-EZ for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Jan 2019 08:21:15 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1go2AN-0002Fa-6C for pgsql-hackers@lists.postgresql.org; Mon, 28 Jan 2019 08:21:15 +0000 Received: from tama500.ecl.ntt.co.jp ([129.60.39.148]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1go2AL-0005M9-Ns for pgsql-hackers@postgresql.org; Mon, 28 Jan 2019 08:21:14 +0000 Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x0S8LAp0021203; Mon, 28 Jan 2019 17:21:10 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 65AB1EA8054; Mon, 28 Jan 2019 17:21:10 +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 5B162EA7FC2; Mon, 28 Jan 2019 17:21:10 +0900 (JST) Received: from [127.0.0.1] (unknown [129.60.241.61]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id 50346400B1B; Mon, 28 Jan 2019 17:21:10 +0900 (JST) Subject: Re: speeding up planning with partitions References: <20181107033207.cdisp33ryrgeidef@alvherre.pgsql> <3be67028-a00a-502c-199a-da00eec8fb6e@lab.ntt.co.jp> <73596f90-023c-c358-be9a-3c21bffcb15d@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A5122E7B1@g01jpexmbkw24> <08a6775f-7c88-81a8-8c2c-984d171b6db9@lab.ntt.co.jp> <0F97FA9ABBDBE54F91744A9B37151A51232FF7@g01jpexmbkw24> <0F97FA9ABBDBE54F91744A9B37151A5124C0A0@g01jpexmbkw24> <580ddb99-cd31-096d-d485-fc309d274498@lab.ntt.co.jp> <55bd88c6-f311-2791-0a36-11c693c69753@lab.ntt.co.jp> From: Amit Langote Message-ID: Date: Mon, 28 Jan 2019 17:21:01 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-CC-Mail-RelayStamp: 1 To: David Rowley Cc: "Imai, Yoshikazu" , Alvaro Herrera , Pg Hackers X-TM-AS-MML: disable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi David, On 2019/01/28 13:18, David Rowley wrote: > On Sat, 12 Jan 2019 at 02:00, Amit Langote wrote: >> On 2019/01/09 9:09, David Rowley wrote: >>> postgres=# update parent set c = c where a = 333; >>> server closed the connection unexpectedly >>> This probably means the server terminated abnormally >>> before or while processing the request. >>> >>> I didn't look into what's causing the crash. >> >> I tried your example, but it didn't crash for me: >> >> explain update parent set c = c where a = 333; >> QUERY PLAN >> ──────────────────────────────────────────────────── >> Update on parent (cost=0.00..0.00 rows=0 width=0) >> -> Result (cost=0.00..0.00 rows=0 width=54) >> One-Time Filter: false >> (3 rows) > > I had a closer look. The crash is due to > set_inherit_target_rel_sizes() forgetting to set has_live_children to > false. This results in the relation not properly being set to a dummy > rel and the code then making a modify table node without any subnodes. > That crashes due to getTargetResultRelInfo() returning NULL due to > rootResultRelInfo and resultRelInfo both being NULL. Oops, you're right. > The attached fixes it. If you were not seeing the crash then > has_live_children must have been zero/false by chance during your > test. Thanks for the fix, I'll incorporate it in the next version I'll post by tomorrow. Regards, Amit