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 1sRwfJ-002KoQ-EX for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jul 2024 16:29:06 +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 1sRwfI-00G6HT-4E for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jul 2024 16:29:04 +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 1sRwfH-00G6HL-LG for pgsql-hackers@lists.postgresql.org; Thu, 11 Jul 2024 16:29:03 +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 1sRwfE-001aMR-Lk for pgsql-hackers@lists.postgresql.org; Thu, 11 Jul 2024 16:29:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1720715339; bh=obyyWoBMPrNa4nNa+j3gdY3mPzvvjUdfJCxdHxbO4fM=; h=Message-ID:Date:User-Agent:Subject:From:To:Cc:References: In-Reply-To:From; b=7AdpruxdyoTcJ9xOTj9l4it1PNYnJ+SWXE3S67Ru7Ur5edrpIrXLF57knoCeKtwBS T3V9vwMgaEswBqBKZrX+MMhjaoXyIGF3U00Qkz+4Gnjmb97DPpSiaUUv3aoD+UHxq4 3RuppX/IvGu2o5CpGnLX0oRfoA3oD62hHKerndF9l4nLapDXXsq6/cgg/XUHXyz5aj rWd35zdT5nqapcr+asqNT7X0n7LMQvJMxc34kJVqhXPYrrpJlcY8arytQTPzaFmm0N TzT5cwA4GG3wTTrAf4Mokq1J+CYPwQxqs6tHY696oAcJwo16zbAivj1mMSBbeFsul8 bshis4znH+rdw== Received: from [10.4.12.74] (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 251EE6029B; Thu, 11 Jul 2024 19:28:59 +0300 (MSK) Content-Type: multipart/alternative; boundary="------------MrIGMVOMcCM6ptzmiuzKTRrY" Message-ID: <6e5d4039-36a4-4190-8e7d-f5d84e6c5d99@postgrespro.ru> Date: Thu, 11 Jul 2024 19:29:02 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC, WIP: OR-clause support for indexes From: Alena Rybakina To: Nikolay Shaplov , pgsql-hackers@lists.postgresql.org Cc: Alexander Korotkov , Andrei Lepikhov , jian he , Robert Haas , pgsql-hackers@postgresql.org, Peter Geoghegan , "Finnerty, Jim" , Marcos Pegoraro , teodor@sigaev.ru, Tomas Vondra , Peter Eisentraut , Ranier Vilela References: <567ED6CA.2040504@sigaev.ru> <196b44d5-f4e5-41a0-9a8f-9fbf26a13760@postgrespro.ru> <9736220.CDJkKcVGEf@thinkpad-pgpro> <2193851.QkHrqEjB74@thinkpad-pgpro> <3b9bb831-da52-4779-8f3e-f8b6b83ba41f@postgrespro.ru> Content-Language: en-US In-Reply-To: <3b9bb831-da52-4779-8f3e-f8b6b83ba41f@postgrespro.ru> X-KSMG-AntiPhishing: NotDetected, bases: 2024/07/11 13:17: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/07/11 13:58:00 #25969612 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 This is a multi-part message in MIME format. --------------MrIGMVOMcCM6ptzmiuzKTRrY Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sorry for repeating, but I have noticed that this message displays incorrectly and just in case I'll duplicate it. On 11.07.2024 19:17, Alena Rybakina wrote: > The errorwascausedby the specificsof storingthe "OR"clausesinthe > RestrictInfostructure.Scanning the orclauses list of the RestrictInfo > variable, wecouldfacenotonlytheitem with RestrictInfo > type,butalsotheBoolExpr type. > > For example, when we have both or clauses and "AND" clauses together, > like x = 1 and (y =1 or y=2 or y=3 and z = 1). The structure looks like: > > RestrictInfo->orclauses = [RestrictInfo [x=1], > RestrictInfo->orclauses = [RestrictInfo[y=1], >                     RestrictInfo [y=2], >                     BoolExpr = [Restrictinfo [y=3], RestrictInfo [z=1] >                    ] >                                          ] > > It'sworkingfinenow. > The error was caused by the specifics of storing the "OR" clauses in the RestrictInfo structure. When viewing the list of or offers, we could encounter not only the RestrictInfo type, but also the BoolExpr type. It's working fine now. For example, when we have both or clauses and "AND" clauses together, like x = 1 and (y =1 or y=2 or y=3 and z = 1). The structure looks like: RestrictInfo->orclauses = [RestrictInfo [x=1], RestrictInfo->orclauses = [RestrictInfo[y=1], RestrictInfo [y=2], BoolExpr = [Restrictinfo [y=3], RestrictInfo [z=1] ]                                          ] It's working fine now. -- Regards, Alena Rybakina Postgres Professional:http://www.postgrespro.com The Russian Postgres Company --------------MrIGMVOMcCM6ptzmiuzKTRrY Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
Sorry for repeating, but I have noticed that this message displays incorrectly and just in case I'll duplicate it.

On 11.07.2024 19:17, Alena Rybakina wrote:
The error was caused by the specifics of storing the "OR" clauses in the RestrictInfo structure. Scanning the orclauses list of the RestrictInfo variable, we could face not only the item with RestrictInfo type, but also the BoolExpr type.

For example, when we have both or clauses and "AND" clauses together, like x = 1 and (y =1 or y=2 or y=3 and z = 1). The structure looks like:

RestrictInfo->orclauses = [RestrictInfo [x=1],
                                          RestrictInfo->orclauses = [RestrictInfo[y=1],
                                                                                    RestrictInfo [y=2],
                                                                                    BoolExpr = [Restrictinfo [y=3], RestrictInfo [z=1]
                                                                                   ]
                                         ]

It's working fine now.

The error was caused by the specifics of storing the "OR" clauses in the RestrictInfo structure. When viewing the list of or offers, we could encounter not only the RestrictInfo type, but also the BoolExpr type. It's working fine now.

For example, when we have both or clauses and "AND" clauses together, like x = 1 and (y =1 or y=2 or y=3 and z = 1). The structure looks like:

RestrictInfo->orclauses = [RestrictInfo [x=1],
                                          RestrictInfo->orclauses = [RestrictInfo[y=1],
                                                                                    RestrictInfo [y=2],
                                                                                    BoolExpr = [Restrictinfo [y=3], RestrictInfo [z=1]
                                                                                   ]
                                         ]

It's working fine now.

-- 
Regards,
Alena Rybakina
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--------------MrIGMVOMcCM6ptzmiuzKTRrY--