Alexander Kuzmenkov <a.kuzmen...@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