Re: Predicate migration on complex self joins

Поиск
Список
Период
Сортировка
Искать
От
Kevin Grittner
Тема
Re: Predicate migration on complex self joins
Дата
Msg-id
4A5B28590200002500028720@gw.wicourts.gov
Ответ на
Список
Дерево обсуждения
Predicate migration on complex self joins Simon Riggs <simon@2ndQuadrant.com>
Re: Predicate migration on complex self joins Tom Lane <tgl@sss.pgh.pa.us>
Re: Predicate migration on complex self joins Simon Riggs <simon@2ndQuadrant.com>
Re: Predicate migration on complex self joins Sam Mason <sam@samason.me.uk>
Re: Predicate migration on complex self joins decibel <decibel@decibel.org>
Re: Predicate migration on complex self joins Jaime Casanova <jcasanov@systemguards.com.ec>
Re: Predicate migration on complex self joins Robert Haas <robertmhaas@gmail.com>
Re: Predicate migration on complex self joins "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: Predicate migration on complex self joins Tom Lane <tgl@sss.pgh.pa.us>
Re: Predicate migration on complex self joins "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Simon Riggs  wrote:
> select count(*) 
> from foo1 a, foo1 b 
> where a.c1 = b.c1 /* PK join */
> You may well ask who would be stupid enough to write SQL like that.
> The answer is of course that it is automatically generated by an
> ORM.
We had to do something like that to get acceptable performance from
Sybase ASE.  That code probably has not been changed since migrating
to PostgreSQL, and since we have a strong portability mandate, it
probably should be left alone, since the penalty for the extra join in
PostgreSQL is small and the penalty for not having it in Sybase ASE is
large.
In short, it would be a welcome optimization here, although (in our
case) a relatively minor one.
-Kevin

В списке pgsql-hackers по дате отправления
От: Andrew Dunstan
Дата:
От: Tom Lane
Дата:
FAQ