Re: Predicate migration on complex self joins

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Predicate migration on complex self joins
Date: 2009-07-14 16:09:26
Message-ID: 20090714160925.GA5407@samason.me.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Stefan Kaltenbrunner 2009-07-14 16:21:05 Re: Launching commitfest.postgresql.org
Previous Message Jaime Casanova 2009-07-14 15:58:03 Re: Sampling profiler updated