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 1tz9pj-00Fv7M-Oq for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Mar 2025 07:45:23 +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 1tz9pi-001umZ-Gr for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Mar 2025 07:45:22 +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 1tz9pi-001umR-7B for pgsql-hackers@lists.postgresql.org; Mon, 31 Mar 2025 07:45:22 +0000 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tz9pg-002Bor-0f for pgsql-hackers@postgresql.org; Mon, 31 Mar 2025 07:45:21 +0000 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-43ea40a6e98so383765e9.1 for ; Mon, 31 Mar 2025 00:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743407119; x=1744011919; darn=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=SArcckTeucbllMkQn1mMYupR1R63b3aJ7yAJAcOeiGw=; b=RglPEcbwFKHl6Ug1kGycsqb/yWJhc5k8YKlBaro9xLFPCOhbgjToHLhiw/S+SlR9Rv kI7Km+X6w4vJT/lFvMwaXxDLk4BTgE4mVGmKQJrsw0RCiZ1lmQPqx6pPdIa2KQiO/duR qvREdIMJm3x1+MkQ6OQaDaVI7ILEog5b7VqxB+HCVOlMLZ3A6s4fcvcz6MjDjnJlJb3N PdlUypV4NzdeyUqsQ9K6GtTYiq5vtFlfg/8l8RaF9ZMa56Sax3XauJg2lhzDk07slyXY 8Ql4YVoCrcWgA/WL2FbFfjUlT8daT5FMmg0PU8bgmMvPwJN0BX6hOKdmdGENN7Dyo5A8 lJMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743407119; x=1744011919; 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=SArcckTeucbllMkQn1mMYupR1R63b3aJ7yAJAcOeiGw=; b=SyXW2Lc6tvCoSXQ3NlJwoNRkDnaRqK5PfWuqWbAjnWkhrZV3fwV0Lnu4tCd0QvNIKO sZGVO7IHOUCdjHAgQwwV9A98ZJxzi3KxjJimA6vyu765jG6qSCvNP7rdrIzDfIUsuYP1 yNIrwDNIaGuiNVXhx6K/hoBGHu0MV2peY1bWQjhsg2La2bxKH0+IRENTnTH85nQp75PE iJbXS5xAUyTXsLtrlhHYzVAc8A+drCSBZHZOKfbnfEAZBtGvhVF4y8aQi095p3N+Kvpb 5jjkD6ADKBN2jSJNuelC6d6DSs041RCx8hSmN984jwivK3lvUKQSbTKAB0B9gCJ/4vKq DrIg== X-Gm-Message-State: AOJu0YwisX3DXS7AWJUym9wGxECb+aUVm0aAyhapEoTP778rNLkkTlyI al9mzmopDrF/SXZHnhSyX9DHnwTvwWTMM0eT0wUkJ5nBv6STyNzX X-Gm-Gg: ASbGncttkxaeJr1MXCJ0v9zPou83/BCjKurycyFmQtr/D4Ff10Q3+UmPnA/7SbzK+bj xdyTtwQwxDOP0JWWHI8foiVFbKNm1nusXY9Zq9j/Viazog/F4nflaGB1F0HdnMlU3PnQwWlJmO5 BpyCgmoPRhZEyQaNW6s3Fchj55cvnchyrNYQb07cIu+ocos4u/D7vVNcxtt9wHe1PuiFT9SW8YD QL9cpHKUXlAH8J1ALhnM7Afkm8HX60bNgf/8MMwn8XgWTQVA3RVUMXJ5Pl1tTcT6qJC2B48zsxg QTNkxOl6VCCut6wpU/Hib05/u9Jt5eB8s7K/RSae8VEcIHi6jlFprLscWgrpeIqJBf/tQ8gy4St QuE4= X-Google-Smtp-Source: AGHT+IFXlJZzYiVHcz/ZkBodCTyw2i8IQCbuAdhASLBfpGsjw5msjTJHxRzurzTlZCMD3yYnVjziHA== X-Received: by 2002:a05:600c:154d:b0:43c:f332:7038 with SMTP id 5b1f17b1804b1-43db62c0180mr63716045e9.21.1743407119100; Mon, 31 Mar 2025 00:45:19 -0700 (PDT) Received: from [192.168.0.89] (84.123.232.230.dyn.user.ono.com. [84.123.232.230]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c0b79e304sm10565551f8f.73.2025.03.31.00.45.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 31 Mar 2025 00:45:18 -0700 (PDT) Message-ID: <45752440-dbd0-4bbc-9d86-62e98db6bc03@gmail.com> Date: Mon, 31 Mar 2025 09:45:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Memoize ANTI and SEMI JOIN inner To: David Rowley Cc: PostgreSQL-development , Alena Rybakina References: <60bf8d26-7c7e-4915-b544-afdb9020011d@gmail.com> <95586c5d-2632-4f1c-bfb9-4c391f260de4@gmail.com> <26e6dd23-ad56-4e00-8a24-c84b508267aa@postgrespro.ru> Content-Language: en-AU 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 3/31/25 05:33, David Rowley wrote: > I can't say definitively that we won't find a reason in the future > that we should set inner_unique for SEMI/ANTI joins, so I don't follow > the need for the Assert. > > Maybe you're seeing something that I'm not. What do you think will > break if both flags are true? I considered targeting PG 19 and July Comitfest for this feature, but currently, I don't see any further development needed here. What are your thoughts, David? Does it make sense to commit this to PG 18? I have no reason to rush the process, but this feature seems beneficial for practice. When the internal structure is a bushy join tree, producing even a single tuple can be costly. SQL Server's Spool node addresses this issue, and people sometimes experience confusion detecting degradation during migration with specific queries. -- regards, Andrei Lepikhov