Re: POC, WIP: OR-clause support for indexes - Mailing list pgsql-hackers

From Alena Rybakina
Subject Re: POC, WIP: OR-clause support for indexes
Date
Msg-id 6e5d4039-36a4-4190-8e7d-f5d84e6c5d99@postgrespro.ru
Whole thread Raw
In response to Re: POC, WIP: OR-clause support for indexes  (Alena Rybakina <a.rybakina@postgrespro.ru>)
List pgsql-hackers
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

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: CFbot failed on Windows platform
Next
From: Alexander Lakhin
Date:
Subject: Re: speed up a logical replica setup