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 1tLIfI-00DyQ0-G0 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2024 09:05:52 +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 1tLIfG-00EXlk-0C for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Dec 2024 09:05:51 +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 1tLIcC-00EUVt-Pc for pgsql-hackers@lists.postgresql.org; Wed, 11 Dec 2024 09:02:42 +0000 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tLIcB-002EFx-7X for pgsql-hackers@lists.postgresql.org; Wed, 11 Dec 2024 09:02:41 +0000 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-21661be2c2dso21978985ad.1 for ; Wed, 11 Dec 2024 01:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733907758; x=1734512558; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=qB+etTGs+N+nLmjT4wu0uuH1l+BQdobVV6daJnwc+dc=; b=NDOS18h+2sRh3P4EVbUuk6Mus89sTbdqcZQaEuRXF8/P76XxOmGOA7nzVi5bd6iO3F r6hEz7K8jyNuKOrnY2K/zRw8NT1ROWgB34JEf/ZAugE3TSt7+XmmokrN4tmfK2BPNARj 2bFgXKodNCGR761gdjTJ17TEfzS5SjF4PZ1hLkTxLyxaPlSHuBQqzwAI1DXNUvpHWWmy naP3UJcE/ko+tG3mTQQAjvk+iF4CeUEh4OpoHN6MKQHidzgTGtzPNbotQ8CGUl1mu15N aKyhz3lJoVGLkhtW6psu4zWGRMHsQB3IvGl2frUJfP/P+kJfBK1zH+c1zZVISR5tceYr 8idQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733907758; x=1734512558; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qB+etTGs+N+nLmjT4wu0uuH1l+BQdobVV6daJnwc+dc=; b=gxMWVlbHg3qdyGex0R3WSMCFW6mCzJ20ZbcymLLkKpLk/ckMzohhPf3gRdbjY/Oqr6 nvu9RczznFgC1DYOEV7rg2jCMmJYGogIXs1t9yS+9zFMJccmlKkT+X2sRHMBjZPk2vH/ DlFzXjHhxh3yTLfFQc+lI8qq6p0op1l4hkfuGm8s4kZiSfu7OPmLoifkSss/guZ8hr5H Pok49UE4cVhkfRfOummN0kN7nr5Q0hvbKWea91XniEIw4h0sOmep7h2NEme3HIHh0VOf N6c657bPRYm7T6U1KNnSQLpria9MIXiUu1TowzXOBBlJcdUaTN4o/BDq5xopf180et7w zNuw== X-Forwarded-Encrypted: i=1; AJvYcCV99OXRnjw9CM56Tr/9yqCXcCY2QyPDbnmLZ2QtnQLKV/MJX89xuQ83GZIkD6U9H+po+JJ95mp7bS4JBfOE@lists.postgresql.org X-Gm-Message-State: AOJu0YzhmwqINlAmOgbeNooT6MlTbw0AlTs4gILH/nFQ5UiZxjW2Whuh RKfN7DK5Ply+Z+ZRonLqqWSb0nLhvwcm83rwpVggzB85+ryyR34f X-Gm-Gg: ASbGncsmt6Pjb4HHTVa3ialxUv+LOTeEviUP1JWdi/APjkns7wkV6uvEGUc6rNAWdvs tnhOq5woNs9GwbxUT6DrtjRkug4vfX75E4TdRIGKwIlQuQJtgDNpVB7tFTyZ9goXQZvH9m5p5hA KQkGR2ek2XnmU9/yWNX7arpb09mrTjB5E8b1a8QqbLK4GXzd/9Uy517a/i04+FGeps6IFTTSVzo eyGSeuBBm6welFTzi/K9qbwSsg46R21GAp6w9KenWY6AwzBJyN37iHVa1bgrhWbgLpyj96QfBjr dsESDhNPXUhILGCw2M5Rv0j6ogSGnSo= X-Google-Smtp-Source: AGHT+IFyHx7mv8x7wffQbfygnhv9WAzCfc3z6zgDLtWiUaNVCJ/Db8A6/RlosftpvFOQ4YNFUY+XJg== X-Received: by 2002:a17:902:cf07:b0:216:7ee9:220b with SMTP id d9443c01a7336-2177851f7c5mr40213505ad.22.1733907757771; Wed, 11 Dec 2024 01:02:37 -0800 (PST) Received: from [192.168.1.50] (cm-171-100-79-18.revip10.asianet.co.th. [171.100.79.18]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2164d103993sm48621265ad.193.2024.12.11.01.02.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Dec 2024 01:02:37 -0800 (PST) Message-ID: <3c83675a-fdc5-4908-8584-fdc874f5fced@gmail.com> Date: Wed, 11 Dec 2024 16:02:32 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Removing unneeded self joins To: Alexander Korotkov Cc: Tom Lane , Robert Haas , Richard Guo , Alexander Lakhin , "Gregory Stark (as CFM)" , Dean Rasheed , =?UTF-8?Q?Micha=C5=82_K=C5=82eczek?= , PostgreSQL Hackers References: <64486b0b-0404-e39e-322d-0801154901f3@postgrespro.ru> <735b5cd4-568d-fbf7-ad8c-dcfb4c3af86e@gmail.com> <2422119.1714691974@sss.pgh.pa.us> <24e93efd-eeac-43a6-a75a-ad68eacb32ee@postgrespro.ru> <3622801.1715010885@sss.pgh.pa.us> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: 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 On 9/12/2024 13:03, Alexander Korotkov wrote: > remove_self_join_rel(). Should we better add comments to PlannerInfo > and other relevant structures saying: if you're going to modify this, > consider how that affects remove_self_join_rel()? > > Any thoughts? As I see, it is quite typical to keep two parts of the code in sync by mentioning them in comments (see reparameterisation stuff, for example). This would reduce the code needed to implement the feature. -- regards, Andrei Lepikhov