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

From: Alena Rybakina <lena(dot)ribackina(at)yandex(dot)ru>
To: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
Cc: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>, Marcos Pegoraro <marcos(at)f10(dot)com(dot)br>, teodor(at)sigaev(dot)ru, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>
Subject: Re: POC, WIP: OR-clause support for indexes
Date: 2023-07-11 18:11:31
Message-ID: 3ec856b1-51bd-9b5e-e644-6831a8a1df7c@yandex.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

On 11.07.2023 11:47, Andrey Lepikhov wrote:
> This patch looks much better than earlier. But it definitely needs
> some covering with tests. As a first simple approximation, here you
> can see the result of regression tests, where the transformation limit
> is set to 0. See in the attachment some test changes induced by these
> diffs.
>
Yes, I think so too. I also added some tests. I have attached an
additional diff-5.diff where you can see the changes.
> Also, I see some impact of the transformation to other queries:
> create_view.out:
> (NOT x > z) ----> (x <= z)
> inherit.out:
> (((a)::text = 'ab'::text) OR ((a)::text = ANY ('{NULL,cd}'::text[])))
> to -
> (((a)::text = ANY ('{NULL,cd}'::text[])) OR ((a)::text = 'ab'::text))
>
> Transformations, mentioned above, are correct, of course. But it can
> be a sign of possible unstable behavior.
>
I think it can be made more stable if we always add the existing
transformed expressions first, and then the original ones, or vice versa. T

o do this, we will need two more lists, I think, and then we can combine
them, where the elements of the second will be written to the end of the
first.

But I suppose that this may not be the only unstable behavior - I
suppose we need sorting result elements on the left side, what do you think?

--
Regards,
Alena Rybakina
Postgres Professional

Attachment Content-Type Size
diff-5.diff text/x-patch 7.4 KB
v6-Replace-OR-clause-to-ANY-expressions.patch text/x-patch 32.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2023-07-11 18:17:23 Re: tablecmds.c/MergeAttributes() cleanup
Previous Message Alexander Lakhin 2023-07-11 18:00:00 Re: stats test intermittent failure