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

From Tom Lane
Subject Re: Removing unneeded self joins
Date
Msg-id 3295.1526486926@sss.pgh.pa.us
Whole thread Raw
In response to Removing unneeded self joins  (Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>)
Responses Re: Removing unneeded self joins  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru> writes:
> There is a join optimization we don't do -- removing inner join of a 
> table with itself on a unique column. Such joins are generated by 
> various ORMs, so from time to time our customers ask us to look into 
> this. Most recently, it was discussed on the list in relation to an 
> article comparing the optimizations that some DBMS make [1].

This is the sort of thing that I always wonder why the customers don't
ask the ORM to stop generating such damfool queries.  Its *expensive*
for us to clean up after their stupidity; almost certainly, it would
take far fewer cycles, net, for them to be a bit smarter in the first
place.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Konstantin Knizhnik
Date:
Subject: Re: libpq compression
Next
From: Robert Haas
Date:
Subject: Re: postgres_fdw: Oddity in pushing down inherited UPDATE/DELETEjoins to remote servers