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.96) (envelope-from ) id 1wFmgN-005XcD-2F for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 05:33:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFmgM-00HCeJ-2f for pgsql-hackers@arkaria.postgresql.org; Thu, 23 Apr 2026 05:32:58 +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.96) (envelope-from ) id 1wFmgM-00HCdL-1g for pgsql-hackers@lists.postgresql.org; Thu, 23 Apr 2026 05:32:58 +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.98.2) (envelope-from ) id 1wFmgK-00000002aqk-2VMR for pgsql-hackers@postgresql.org; Thu, 23 Apr 2026 05:32:58 +0000 Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-43fe62837baso3729366f8f.3 for ; Wed, 22 Apr 2026 22:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776922375; cv=none; d=google.com; s=arc-20240605; b=dd+3bX+yMMbVrHMXvM7s2YP52mUpQ7ZXQlwv0w69PhMjwcGtbnmFYXwpH301uxs8aO /QvSehI4SZ9js7declW/VY6mkcFbdP/bWB1EV1UfFRb6TQ8RZ9hCXDixMJUqqkiSunH1 d0nDzz3wVmH659CyI1UaEsZnW3Urc9W54HBnSfwi3w0/VrhNwmhXczg75E2FKbR54npw E+tGaPuImiOb6h5IEGbiqTd0K3jplsGFe4btaSakfQl838lSMgrOkqzbwQFbxXM3CclH aRK8WgvE2lPr6mY+fFr2whKtAXrnAJGhHBYk8JtYAIspzCT1P4o6qkyx7x0HxY0RO8Yj xwZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=vzp6zfVTVYVavadZhjwbct1oU4BlywtfgBg4Yr1PCGk=; fh=fwhEmq/mwFwAqqO5QYtDklFO2aBO7bGeoiEvA/gwRR8=; b=Y4lCmppmaKLEiXSszfWhmhOjQ8iWto7mbt8fFwc13dX6+1uXGbCFg+eeu1KPBi0yaj Kd0P0z8haThjStwhEoqlr5of+heQ1KtdiLcqFY7cywrVaA6QmopNkggRNPBPt+OLph4h njyxQGSbncvziqMSkot/J+XuGt3W7mN0G0kb347Q13pPR1h0fZRUw88nAoCbaNSSF+i1 qsydf1tLUgnougQxGUMAjbbo0PNRZNWKPRlak4XbJWLhuLjPlzczRlLHnat/90HrVQrv weq1QoO3JmmC+HZQe8VXCAFEjVvNfRFHhQYuZP5dZ/ZMQ5POKkusCfUuysYqqnBDJTj9 FVdA==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776922375; x=1777527175; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=vzp6zfVTVYVavadZhjwbct1oU4BlywtfgBg4Yr1PCGk=; b=rrgIbamMheoTpwsUAE4H5z+tkDb1bu7qV6G5I+/Cy6R0CItBYUUUe1FnIm1G9rD1Wb EIqppPzXmOVAxxw6vhew1YJ1PV/iNG3D0c3Sma2ebJBU3kmD1/j4vGxTAUsmHDC3bAlw v/b8ypJOZiWkVDkui319qTnDMVR/fznX+yk1tHcCfdSTUmlFalwNkQugAvdDvVQg50Dh 3286R8DOj+Vw7gQ0qAdHpFmkkg3u0RERwSowC7yFnUFBITzMD2msnz0yhcmVgxrjuD+3 xYzsWq5rh4XnbCEiwawgGmN7xCUsJYXhKz8hcJpB2Or9b4mfQZsOm87apGmeMNCSZwr1 JBuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776922375; x=1777527175; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vzp6zfVTVYVavadZhjwbct1oU4BlywtfgBg4Yr1PCGk=; b=UgCdRALF32ooB7/qvuu9ySuTilWRXlO6hmdOb2ROctDDmb5pYoMHD4EgGHXhtxHHM6 GkPUXH+HHt/QDdcGfhzYRfnWu2vpvS5LYdJ/q9pVvRLwJX2z7Q04cP+fCN+e08tPJeXU X7/Grk9yL8IcGKrojOUzpRdZ9bcpRZ//Kpp+OX5AJpD1IpGCy9FEjJnbH6tnI0pQj7Xu Oz2ewWZAmeY2yThwjruJl09BxgngltnpWQQfrQvQeUFN27xUP4L6WjzQKzj4aFowl7n3 f2baOEEUei8avnh96ShXM4EBTHwbleC1X6xcTAHvmeDHNb8XnZp+jlByyYtZdhxeLf/W eHpg== X-Gm-Message-State: AOJu0Yx7eHgTBhMXKDvkC9yQfoUMuviRT2NbHwTJrxSrE6IAz38wkWMd m97WJpn3pERTZgCju375qDa6Ukc1kJDp7p5Q383dRLlY8RIQWFF0bEYP+autDvZo6zrDuJmIrX9 jtNNgIkmEk0pVo8vYl4UJYtsR/LP6ZHE= X-Gm-Gg: AeBDieslzYEcSLW0o4HhdcKHjl+8RMP8uyjteRJmbjf0g73RyGQndT4ZDW43TE04qF+ 6Rf14kisqBuxih/qgRIxg1FuZLJU8vl2eyPA184og3wYZ64CLZHjr/GUJ1KOG8AyRZIH6OK/ZcE zLxQso8inavwdht1KCugqnMF54Q2cS4lQ/p7bGCBX1Kk7NQhTMBmRtusaqVq2j5u2ULpudB1rNy /VGbeP8zY/+23HuYMX4PqWIbFDV+U7K+LKb1oOEoG2HMikJDzuAvtgWbW+gXFD9wRP3gaspw9jh 9i55XLgfmfdDD0JjeAG6fi0Pz3y7PBRKJyZL6/IvHWt+nBo17lGLgnJ+uYOB9yTvNHHE8GqS3TP oQ3+K6kI= X-Received: by 2002:a05:6000:144d:b0:43d:7403:4b63 with SMTP id ffacd0b85a97d-43fe3e0b862mr37568835f8f.44.1776922375438; Wed, 22 Apr 2026 22:32:55 -0700 (PDT) MIME-Version: 1.0 References: <5CDAD4B4-6DC6-4C31-8AC1-1F45EA6ED480@outlook.com> <614EFDA0-6858-4C14-9E6A-53FC4EABE1AA@outlook.com> In-Reply-To: <614EFDA0-6858-4C14-9E6A-53FC4EABE1AA@outlook.com> From: David Rowley Date: Thu, 23 Apr 2026 17:32:43 +1200 X-Gm-Features: AQROBzABpQNrNfsuY-jxRTU5cGwFvEBbun6wSYfaWEmpm3AU0WeyoirHezJI4Ik Message-ID: Subject: Re: [PATCH] Fix hashed ScalarArrayOp semantics for NULL LHS with non-strict comparators To: Chengpeng Yan Cc: PostgreSQL-development , cca5507 , Tom Lane Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for looking. On Thu, 23 Apr 2026 at 16:31, Chengpeng Yan wrote: > One possible improvement, though not > a blocker, would be to defer the lhs-NULL handling until we actually > encounter the first NULL on the lhs. That could avoid a bit of extra > work in the common case where the lhs contains no NULLs. I thought of it, but didn't do it as it meant having to keep a bit more state to track if we've filled the cache yet, plus the extra costs incurred to check if we've done it yet that would have to be paid for every NULL lookup. We currently have to check if the hash table has been set up already, so I felt more comfortable installing the new code in with that. David