Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxIJY-00HRVX-Tt for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Oct 2023 02:47:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxIJX-00AWto-F4 for pgsql-bugs@arkaria.postgresql.org; Mon, 30 Oct 2023 02:47:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qxIJX-00AWtf-6c for pgsql-bugs@lists.postgresql.org; Mon, 30 Oct 2023 02:47:39 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qxIJV-003kxW-20 for pgsql-bugs@lists.postgresql.org; Mon, 30 Oct 2023 02:47:38 +0000 Received: from [192.168.1.35] (cm-171-100-241-215.revip10.asianet.co.th [171.100.241.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: a.lepikhov@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id CB085E203E9; Mon, 30 Oct 2023 05:47:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1698634056; bh=vOBuz8bspE3xkgG3gu+JT9qliQEZJ+kBVf+VQLmwqbw=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=wAtfA1ew/da6yFf2rR7LBNF6OcZWetLmm4nyr1SxZrmM8qMcaulvzQZlWVx9S+Qvw J7ZLZVeIX5QOeBG84wf/J0ck7A3+X06xzfdrPMjACS4qbz2vuwesWUQHCptnY7oYsp /2mNErHo+TDIjWa0PIrjzrMjmw5R54mSiVNQYD8E3Cw7Qjbv6HoR4tvozvlr+LQ+L9 X5cSlgER5q3BuheVn5zGwNwhZfg+8t1k5i76LuPF0S+NdLHH38tYSd+SDfnRGGcP0z 3tpqdkeje4hO5t0kyHb2S4QDhAJfy9xGXcBg8dNymRP30dLTEjs0Oi6sajHtS5fHae 4Imhq8hQ5A83g== Message-ID: Date: Mon, 30 Oct 2023 09:47:32 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18170: Unexpected error: no relation entry for relid 3 Content-Language: en-US To: Richard Guo , Tom Lane Cc: Alexander Korotkov , Vik Fearing , zuming.jiang@inf.ethz.ch, pgsql-bugs@lists.postgresql.org, Alexander Korotkov References: <18170-f1d17bf9a0d58b24@postgresql.org> <4ecab120-6be3-4cf6-a2a0-249c73ae91d4@postgresfriends.org> <1189851.1698340331@sss.pgh.pa.us> <011bcae5-7840-42c7-a50c-b406189e2e78@postgrespro.ru> <721542ce-79df-469e-93e9-811fadb5bd0c@postgrespro.ru> <2eb87c2e-7e6f-4002-8df3-8fac3aa6a037@postgrespro.ru> <2141583.1698595016@sss.pgh.pa.us> From: Andrei Lepikhov Organization: Postgres Professional In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 30/10/2023 09:24, Richard Guo wrote: > > On Sun, Oct 29, 2023 at 11:56 PM Tom Lane > wrote: > > Alexander Korotkov > writes: > > I made some beautification of the patch by Andrei.  I also > removed the > > part which changes the target list for estimate_num_groups().  Any > > objections to pushing this? > > It seems moderately likely that this will break as much as it fixes. > > I've not studied the original patch enough to understand why you need > to be playing strange games with tree mutation rules, but I suspect > that this is band-aiding over some rather fundamentally bad code. > > > I also have some concerns about this patch.  It requires that > root->parse remains unchanged during the whole subquery_planner() in > order to work, which is an implicit constraint we did not have before. It is not about unchanged; it is about referencing the same query at the parent and child query blocks. Am I missing something? -- regards, Andrei Lepikhov Postgres Professional