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

From Ron Mayer
Subject Re: Planner creating ineffective plans on LEFT OUTER joins
Date
Msg-id 486407B7.7060105@cheapcomplexdevices.com
Whole thread Raw
In response to Re: Planner creating ineffective plans on LEFT OUTER joins  (Simon Riggs <simon@2ndquadrant.com>)
Responses Re: Planner creating ineffective plans on LEFT OUTER joins  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Simon Riggs wrote:
> IMHO we should have a single parameter which indicates how much planning
> time we consider acceptable for this query. e.g.
>  optimization_level = 2 (default), varies 1-3


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

Or maybe as simple as something like

if (time_spent_planning >= cost_of_the_best_plan_found / 10)  stop_optimizing.

If we wanted a GUC, perhaps make it that 10 in the expression above?



pgsql-hackers by date:

Previous
From: "Dickson S. Guedes"
Date:
Subject: Re: TODO Item: Allow pg_hba.conf to specify host names along with IP addresses
Next
From: Tom Lane
Date:
Subject: Re: Planner creating ineffective plans on LEFT OUTER joins