Re: Removing unneeded self joins - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Removing unneeded self joins
Date
Msg-id 20180516185840.a7crgjho7txxqmi4@alap3.anarazel.de
Whole thread Raw
In response to Re: Removing unneeded self joins  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Removing unneeded self joins  ("Jonathan S. Katz" <jkatz@postgresql.org>)
List pgsql-hackers
Hi,

On 2018-05-16 12:26:48 -0400, Robert Haas wrote:
> Also, I'm not sure that I believe that it's always easy to avoid
> generating such queries.

Yea. There's obviously plenty cases where ORMs just want to make the
database hurt. But especially when building a join between a number of
tables based on various fields, it's not going to be easy for the ORM to
figure out which ones can be safely omitted. It'd need similar
optimization as we'd have to do, without having the infrastructure core
PG has.  And then there's, as you say, views etc...

Greetings,

Andres Freund


pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Incorrect comment in get_partition_dispatch_recurse
Next
From: Robert Haas
Date:
Subject: Re: Odd procedure resolution