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 1tzueD-008Seg-2l for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Apr 2025 09:44:37 +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 1tzueB-00BZP5-BU for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Apr 2025 09:44:35 +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 1tzueB-00BZOx-23 for pgsql-hackers@lists.postgresql.org; Wed, 02 Apr 2025 09:44:35 +0000 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzue8-002wLP-2t for pgsql-hackers@lists.postgresql.org; Wed, 02 Apr 2025 09:44:34 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3996af42857so445221f8f.0 for ; Wed, 02 Apr 2025 02:44:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1743587070; x=1744191870; 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=i5kzpm7Tskip6Egj5R/NRZJidtsigGaBEwsYxm5Zmqw=; b=cFhgzTrXD3o0zufGVfDurYpZ3LYBX5QJNLe9LDC63Tih7nnxJ0NWtoR2f8bbHRzuni X6OpzA1tvHM7oQZfePITP4QZoQREp9fp/zc7KAGWrxDJMWWmmCG7APc8Pf/mEUsCqGrA msfdCNZehBLearC5KX5p6C2UKGV/SMGtVZhoteD+CNgKnx52JGdOCZGQIk28fB1O/yhz 3sJhGZEtNZC2NFJDKdH4SWovWT7uKc9zc6hcywkKO1GiWPKCOYHvYLXFQ/jT7+saNGNm zo0cRh3rdJF2WSJbfIn/2qKC69jMOaNpIizmxdL8TO0bGRXSfq9BRLpxTyhgBy+idpJs JslQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743587070; x=1744191870; 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=i5kzpm7Tskip6Egj5R/NRZJidtsigGaBEwsYxm5Zmqw=; b=vLFoOlUx7Lppqjvqlu9194NEhTh86pBoXyvGdDMQuBDigNeq7ZNXzFkMg9Az/0ZFHs JKNaK3sFs5RoiHGdLTeWfzTLY9SvvpbDgCE76vl6S3kvlMHj52mEFltIrxGuN18VsifE a3zzhvrsDRJAXB1j3oM21xFnzJ7FbU0i6hjjDZgt1epRNuqfLWOIKvZCOaT9XX15PRYs TjXh9xvb1rGXlYimLgUo4QxbSqHzq876QzX7PD9SWaaBT81k5t2M0sZaFQhj7L2NiZlg rhSjBTJfjJ/v1VDQ9uGa0DOQqPossol1dt5fA4fqgGoRyDbtR1vd0Iqa/khAYtrU+1/p YMeg== X-Gm-Message-State: AOJu0Yxdflovml/Dh046qi4NHhbRjv5a+OBiPtHE0KONkJpHRjyJhfnO IoG1Oy25RjEik3PaJJ0FeA+y3NgWu4D4MH+TWFYMkW9Ly4HqWgOI X-Gm-Gg: ASbGncsyAa4R/t4UqanWEBxIYpJlG5YfjiAqRpjQ49iPbyrK7yW/ix02JSh3NrEm0l3 KUWDWcJBBUCDgKha3B/vbkyqXhZwddJ1TAD/6DM9DcCXO/wD7C2pkdXn0NsmunZ+9z9zssG1KXL 57v+tNHe8Zplm/C5KmUjUPLjnCEfjBy+jmZg4D8ZGtCYJ2Xz1sJZBV5bdSz+AmRmlSBMp5NkFrF r2IoGcvdWWQ/sXUnAweuDPAz2e3IhgvenG9WvB1D29z57MR0hOW2arWC9bcvTiRI0WuYNy2DuEM GSn2iBWFH8qxJhcR6Mw3qTjDfWUO85M4VkA9XmGQLeNdRF3Ish9ONm/3b3S+o2E= X-Google-Smtp-Source: AGHT+IGu7s8Qa7K5VMGL/aia7gcEeOv0eCH1WBSmNRIIYnglcDVTjITSBAO6ItQLvOPI3TosDglL3A== X-Received: by 2002:a5d:5848:0:b0:39c:266c:434 with SMTP id ffacd0b85a97d-39c2a396dc8mr1173411f8f.27.1743587070314; Wed, 02 Apr 2025 02:44:30 -0700 (PDT) Received: from [192.168.2.60] ([147.161.235.14]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c0b79e0dcsm16577671f8f.64.2025.04.02.02.44.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Apr 2025 02:44:29 -0700 (PDT) Message-ID: <90f12d4a-e8b2-405a-9907-5bf205167961@gmail.com> Date: Wed, 2 Apr 2025 11:44:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Hashed IN only applied to first encountered IN To: David Rowley Cc: pgsql-hackers@lists.postgresql.org References: <29a76f51-97b0-4c07-87b7-ec8e3b5345c9@gmail.com> Content-Language: en-US From: David Geier 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 Great! Thank you! On 4/2/2025 1:00 AM, David Rowley wrote: > On Wed, 2 Apr 2025 at 01:31, David Rowley wrote: >> On Wed, 2 Apr 2025 at 00:51, David Geier wrote: >>> The hashed IN optimization is only applied to the first encountered >>> ScalarArrayOpExpr during the expression tree traversal in >>> convert_saop_to_hashed_saop_walker(). Reason being that the walker >>> returns true which aborts the traversal. >>> I've also attached a patch with a fix. >> Thanks for the report and fix. On first inspection your patch looks >> fine. I'll have a closer look tomorrow. > I've now pushed and backpatched the relevant portion of this back to v14. > > Thanks again. > > David