Re: Planner creating ineffective plans on LEFT OUTER joins - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Planner creating ineffective plans on LEFT OUTER joins
Date
Msg-id 21375.1214515398@sss.pgh.pa.us
Whole thread Raw
In response to Re: Planner creating ineffective plans on LEFT OUTER joins  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
Responses Re: Planner creating ineffective plans on LEFT OUTER joins  (Ron Mayer <rm_pg@cheapcomplexdevices.com>)
List pgsql-hackers
Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
> Couldn't the planner itself make a good guess if it should
> keep trying based on the estimated cost?

> if (the_best_plan_I_found_so_far_looks_like_itll_take_an_hour)
>    keep_optimizing_for_a_few_minutes
> if (the_best_plan_I_found_so_far_looks_like_itll_take_0.01ms)
>    stop_planning_and_run_with_it

You're operating on a mistaken assumption, which is that we generate a
complete plan and then generate another.  The places where we'd actually
be doing something with an effort variable are usually dealing with
small parts of plans, or even with preparatory calculations before we've
got anything plan-like at all.  They haven't got a sufficiently holistic
view of what's happening to apply a rule like the above.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Ron Mayer
Date:
Subject: Re: Planner creating ineffective plans on LEFT OUTER joins
Next
From: Ron Mayer
Date:
Subject: Re: Planner creating ineffective plans on LEFT OUTER joins