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 1rJAc7-00C06d-Ij for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Dec 2023 11:01:16 +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 1rJAb7-007eL9-K0 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Dec 2023 11:00:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rJAb7-007eJg-A4 for pgsql-hackers@lists.postgresql.org; Fri, 29 Dec 2023 11:00:13 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rJAb0-00CkC0-OL for pgsql-hackers@lists.postgresql.org; Fri, 29 Dec 2023 11:00:12 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ccb923c4d2so41488581fa.1 for ; Fri, 29 Dec 2023 03:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703847604; x=1704452404; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ipPP3e5TTGqleLsqWydbuHbzkM9lXa/4I/HEg0ZfYt8=; b=T+E+zKvnbZJEQWiRKvcdQjwllsl5R59pkvLOOcVgIuiGX3qnWEhe+f9wCPlq+deFyX hHPMJsFWCFdA3RZ5NsZeQWsbekWuvoG05WCMd5bo/SrjQCe63GCFJ/7jfp4PPwkcHAR4 wt9U1yEQzD6U2kvfJC03HQ/BtbBL6mxJrqknZga/crhe9G5D5kS2y+Lx2nxe94Dee60A 9La3rNuqPkMVpiLQqrE8mYwD7PcWDVUv8KU4s4q0xD+YQC+kZwR9VIfu1ImWQdYscp97 8pC9/0m4oSM/XjgtAgFdNv1dfe1uSIyPmOAzmy8tW5osID2gmjlecNIpWQPglNLWcdxN du4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703847604; x=1704452404; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ipPP3e5TTGqleLsqWydbuHbzkM9lXa/4I/HEg0ZfYt8=; b=DmYdZefpjzT/qJiW+5JxVFvYcy4x5pMYh9w4hh6US1fP8/+OZzxrkFor272Dt7QUeG 0ALmyiRLzzfs7nT95K4vra+3JpeviSjlv9bXTg99Xh2bWqjku3zIi6cV9b/D0tc6cFtV bXwDmqTqvZTDJ3uuBXCWiF3WYR/8026cUV0ortbTaENU1N652kMdEAnXYUQAVYQGvoTI /gyr0TXk6p2uXgoB1bWYuTS5yAuZDxVMU62+w0Kuvq6LZpOtLHWtrk4Y914bBZ41qRpv 09d95IRk9xHTNg8pwz+8+UGCMgUn+8T6JcOluv5fKhaYr1+m5qqrN0Ujl3hpu/8JKPGT y0Og== X-Gm-Message-State: AOJu0Ywm5hD17VLVrKhHh9aQk3ZwTrU4558VGrZ4JBTDZfETVlYA5K6h tvcL8voVy6RUXnzCbxC7RqA= X-Google-Smtp-Source: AGHT+IGa0FVextdD5+3d3IXTM90bUjcw0E5fm8w4UHSuvUiVqwRs/Bf2LrmMNRihVoEypeGusnAvmg== X-Received: by 2002:a05:651c:a11:b0:2cc:d650:8c53 with SMTP id k17-20020a05651c0a1100b002ccd6508c53mr2244258ljq.61.1703847603789; Fri, 29 Dec 2023 03:00:03 -0800 (PST) Received: from [1.0.0.7] ([178.155.19.179]) by smtp.gmail.com with ESMTPSA id u7-20020a2e2e07000000b002ccb7e51918sm2522964lju.45.2023.12.29.03.00.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Dec 2023 03:00:03 -0800 (PST) Message-ID: <336c748b-4ffe-5915-3d3c-ece6d19e021c@gmail.com> Date: Fri, 29 Dec 2023 14:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Removing unneeded self joins Content-Language: en-US To: Andrei Lepikhov , Alexander Korotkov Cc: "Gregory Stark (as CFM)" , =?UTF-8?Q?Micha=c5=82_K=c5=82eczek?= , PostgreSQL Hackers , Richard Guo References: <64486b0b-0404-e39e-322d-0801154901f3@postgrespro.ru> <48c11b23-9c23-440e-9a3c-020e05196449@postgrespro.ru> <8800ccf2-ae82-461c-92a1-d4c0a22f8cf2@postgrespro.ru> <1bd80083-a13e-4e9f-a7ce-73c3faab521c@postgrespro.ru> <922623af-872e-4cdc-9238-129b18bee42d@postgrespro.ru> <107682e0-137a-d0fb-2733-7fc6e9562690@gmail.com> <0c5f461f-e26f-4fd9-9700-91b0e9c38fd6@postgrespro.ru> From: Alexander Lakhin In-Reply-To: <0c5f461f-e26f-4fd9-9700-91b0e9c38fd6@postgrespro.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Andrei, 29.12.2023 12:58, Andrei Lepikhov wrote: > Thanks for the report! > The problem is with the resultRelation field. We forget to replace the relid here. > Could you check your issue with the patch in the attachment? Does it resolve this case? > Yes, with the patch applied I see no error. Thank you! Best regards, Alexander