Re: Predicate migration on complex self joins - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Predicate migration on complex self joins
Date
Msg-id 4A5B28590200002500028720@gw.wicourts.gov
Whole thread Raw
In response to Predicate migration on complex self joins  (Simon Riggs <simon@2ndQuadrant.com>)
Responses Re: Predicate migration on complex self joins  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> 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 by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Upgrading our minimum required flex version for 8.5
Next
From: Tom Lane
Date:
Subject: Re: Predicate migration on complex self joins