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

From Sam Mason
Subject Re: Predicate migration on complex self joins
Date
Msg-id 20090714160925.GA5407@samason.me.uk
Whole thread Raw
In response to Re: Predicate migration on complex self joins  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
On Mon, Jul 13, 2009 at 07:06:40PM +0100, Simon Riggs wrote:
> On Mon, 2009-07-13 at 13:33 -0400, Tom Lane wrote:
> > It's hard to believe
> > this sort of case comes up often enough to justify the cycles that would
> > be expended (on *every* join query) to try to recognize it.
> 
> Yeh, damn ORMs seem to spring up faster than vines.
> 
> Not just because of this but I wonder if we might benefit from an
> optimizer setting specifically aimed at the foolishnesses of
> automatically generated SQL.

The best suggestion I heard was to carry on optimizing until the plan
looked cheap enough or all the options had been exhausted.

In practical terms; I think this means doing the planning in two stages,
try with all the "simple" optimizations and see if it results in less
than "n" page accesses, if it's above this level then try again with all
the optimizations turned on.

--  Sam  http://samason.me.uk/


pgsql-hackers by date:

Previous
From: Jaime Casanova
Date:
Subject: Re: Sampling profiler updated
Next
From: Stefan Kaltenbrunner
Date:
Subject: Re: [pgsql-www] Launching commitfest.postgresql.org