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 1shqVm-00A2Q8-D8 for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Aug 2024 13:08:58 +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 1shqVk-005PbK-4M for pgsql-hackers@arkaria.postgresql.org; Sat, 24 Aug 2024 13:08:56 +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 1shqVj-005PbB-Lz for pgsql-hackers@lists.postgresql.org; Sat, 24 Aug 2024 13:08:56 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1shqVf-001GzC-Qz for pgsql-hackers@postgresql.org; Sat, 24 Aug 2024 13:08:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1724504932; bh=1ncuwcgv4E5ZlVQiJDtU0yjn6C9guY7+ChS7dCwagjs=; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From: In-Reply-To:From; b=st+Z7KFu575GhVVSMlcfbCLoQ4T3jPhS+hmDSPickpyvmI1xHyISQvG8teBaZo5P1 qI7bszmieqT26GcPC3Wmps8I2gI8tsq5XwXD2BgXkTyiPNDOda4jHrx32ppWfBCUPn 5ctx4oCs5WHsesKq26Ye9inwrU6WHLn8RfKcrNsHpmE/OowIGXu8a/tA+VMX/1n3Mz Eq0TXLbqpsY9emiheVFINm3qGFBKHRMgZXej4/qB/0GnnZjMOPsda8udMwTGrydho8 zxnJAG6TkeOJMrq5rOqeUC+JIVmwGCK62nbQPyeJrwyN2srbEivr4DqxbPicJ+qjoJ k8HqSQsbxh7MA== Received: from [10.4.9.144] (unknown [93.174.131.141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: a.rybakina@postgrespro.ru) by mail.postgrespro.ru (Postfix/587) with ESMTPSA id E57656046E; Sat, 24 Aug 2024 16:08:51 +0300 (MSK) Message-ID: <82087504-6733-42e1-b0ca-7c319c3b66b8@postgrespro.ru> Date: Sat, 24 Aug 2024 16:08:51 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC, WIP: OR-clause support for indexes To: Alexander Korotkov Cc: Andrei Lepikhov , Nikolay Shaplov , pgsql-hackers@lists.postgresql.org, jian he , Robert Haas , pgsql-hackers@postgresql.org, Peter Geoghegan , Marcos Pegoraro , teodor@sigaev.ru, Peter Eisentraut , Ranier Vilela References: <567ED6CA.2040504@sigaev.ru> <531fc0ab-371e-4235-97e3-dd2d077b6995@postgrespro.ru> <65bfdcb6-0f0c-4d4c-a721-cb38a0ba91c7@postgrespro.ru> <670d1dc2-a280-4cf6-bc29-e2eafb107081@gmail.com> <7aed2a84-41a5-450f-9630-514338172017@postgrespro.ru> Content-Language: en-US From: Alena Rybakina In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-KSMG-AntiPhishing: NotDetected, bases: 2024/08/24 12:29:00 X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2024/08/24 11:54:00 #26424477 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 23.08.2024 19:38, Alexander Korotkov wrote: > Hi, Alena! > > On Fri, Aug 23, 2024 at 5:06 PM Alena Rybakina > wrote: >> To be fair, I fixed this before [0] by selecting the appropriate group >> of "or" expressions to transform them to "ANY" expression and then >> checking for compatibility with the index column. maybe we should try >> this too? I can think about it. >> >> [0] >> https://www.postgresql.org/message-id/531fc0ab-371e-4235-97e3-dd2d077b6995%40postgrespro.ru > I probably didn't get your message. Which patch version you think > resolve the problem? I see [0] doesn't contain any patch. Sorry, I got the links mixed up. We need this link [0]. > > I think further progress in this area of grouping OR args is possible > if there is a solution, which doesn't take extraordinary computational > complexity. This approach does not require a large overhead - in fact, we separately did the conversion to "any" once going through the list of restrictinfo, we form candidates in the form of boolexpr using the "and" operator, which contains "any" and "or" expression, then we check with index columns which expression suits us. -- Regards, Alena Rybakina Postgres Professional: http://www.postgrespro.com The Russian Postgres Company