Re: Implement hook for self-join simplification

2022-06-24 Thread Andrey Lepikhov
On 24/6/2022 23:43, Leif Harald Karlsen wrote: Thank you for the quick answer, and for the pointer to the patch! This looks like just the thing I need! On a more general note: What would, in general, be the best way to implement such optimizations? Is there a good way to do this as an extensio

Re: Implement hook for self-join simplification

2022-06-24 Thread Leif Harald Karlsen
way? Kind regards, Leif Harald Karlsen Senior Lecturer Department of Informatics University of Oslo From: Andrey Lepikhov Sent: 24 June 2022 19:27:50 To: Leif Harald Karlsen; pgsql-hackers@lists.postgresql.org Subject: Re: Implement hook for self-join simplification

Re: Implement hook for self-join simplification

2022-06-24 Thread Andrey Lepikhov
On 24/6/2022 18:58, Leif Harald Karlsen wrote: I have a made a small deductive database on top of PostgreSQL for educational/research purposes. In this setting, due to certain VIEW-constructions, queries often end up being self-joins on primary keys, e.g.: SELECT t1.id, t2.val FROM t AS t1 JOI

Implement hook for self-join simplification

2022-06-24 Thread Leif Harald Karlsen
Hi, I have a made a small deductive database on top of PostgreSQL for educational/research purposes. In this setting, due to certain VIEW-constructions, queries often end up being self-joins on primary keys, e.g.: SELECT t1.id, t2.val FROM t AS t1 JOIN t AS t2 USING (id); where t(id) is a