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

From: Alena Rybakina <a(dot)rybakina(at)postgrespro(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
Cc: 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-06-17 15:21:09
Message-ID: 196b44d5-f4e5-41a0-9a8f-9fbf26a13760@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17.06.2024 15:11, Alexander Korotkov wrote:
> On Mon, Jun 17, 2024 at 1:33 PM Alena Rybakina
> <a(dot)rybakina(at)postgrespro(dot)ru> wrote:
>> I noticed that 7 libraries have been added to src/backend/optimizer/plan/initsplan.c, and as far as I remember, Tom Lane has already expressed doubts about the approach that requires adding a large number of libraries [0], but I'm afraid I'm out of ideas about alternative approach.
> Thank you for pointing. Right, the number of extra headers included
> was one of points for criticism on this patch. I'll look to move this
> functionality elsewhere, while the stage of transformation could
> probably be the same.
Yes, I thing so.
>> In addition, I checked the fix in the previous cases that you wrote earlier [1] and noticed that SeqScan continues to generate, unfortunately, without converting expressions:
> I've rechecked and see I made wrong conclusion about this. The plan
> regression is still here. But I'm still looking to workaround this
> without extra GUC.
>
> I think we need to additionally do something like [1], but take
> further steps to avoid planning overhead when not necessary.

Iagreewithyoutoreconsiderthisplacein detailonceagain,becauseotherwiseit
lookslike we're likelyto runinto aperformanceissue.
> In
> particular, I think we should only consider splitting SAOP for bitmap
> OR in the following cases:
> 1. There are partial indexes with predicates over target column.
Frankly, I see that we will need to split SAOP anyway to check it, right?
> 2. There are multiple indexes covering target column and different
> subsets of other columns presented in restrictions.
I see two cases in one. First, we need to check whether there is an
index for the columns specified in the restrictlist, and secondly, the
index ranges for which the conditions fall into the "OR" expressions.
> 3. There are indexes covreing target column without support of SAOP
> (amsearcharray == false).
> Hopefully this should skip generation of useless bitmap paths in
> majority cases. Thoughts?
I'm notsureIfullyunderstandhowusefulthiscanbe.Couldyouexplainit to mein
more detail?
> Links.
> 1.https://www.postgresql.org/message-id/67bd918d-285e-44d2-a207-f52d9a4c35e6%40postgrespro.ru

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-06-17 15:21:18 Re: Conflict Detection and Resolution
Previous Message Bertrand Drouvot 2024-06-17 15:19:50 Re: Allow logical failover slots to wait on synchronous replication