Re: Removing unneeded self joins

From: Alexander Kuzmenkov <a(dot)kuzmenkov(at)postgrespro(dot)ru>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing unneeded self joins
Date: 2018-08-03 16:49:47
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 07/29/2018 01:42 PM, Thomas Munro wrote:
> I think you need to disable the optimisation when there is a locking
> clause on one side. Maybe it could be allowed if it's on both sides?
> Not sure.

Hi Thomas,

Thanks for testing. I think it should be OK to remove the join if the
row marks for both sides have the same type. I added the code to check
for that.

> You can't declare a variable here in C89.


Alexander Kuzmenkov
Postgres Professional:
The Russian Postgres Company

Attachment Content-Type Size
0001-Remove-unique-self-joins-v4.patch text/x-patch 49.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2018-08-03 17:23:29 Re: Expression errors with "FOR UPDATE" and postgres_fdw with partition wise join enabled.
Previous Message Cynthia Shang 2018-08-03 16:30:39 Re: Allow COPY's 'text' format to output a header