Re: POC, WIP: OR-clause support for indexes

From: Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>
To: Nikolay Shaplov <dhyan(at)nataraj(dot)su>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Andrei Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>, jian he <jian(dot)universality(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, Peter Geoghegan <pg(at)bowt(dot)ie>, "Finnerty, Jim" <jfinnert(at)amazon(dot)com>, Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, teodor(at)sigaev(dot)ru, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Peter Eisentraut <peter(at)eisentraut(dot)org>, Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
Subject: Re: POC, WIP: OR-clause support for indexes
Date: 2024-07-11 16:29:02
Message-ID: 6e5d4039-36a4-4190-8e7d-f5d84e6c5d99@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-07-11 17:00:00 Re: speed up a logical replica setup
Previous Message Andrew Dunstan 2024-07-11 16:28:28 Re: CFbot failed on Windows platform