Skip site navigation (1) Skip section navigation (2)

Re: Planner creating ineffective plans on LEFT OUTER joins

From: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Planner creating ineffective plans on LEFT OUTER joins
Date: 2008-06-26 21:18:47
Message-ID: 486407B7.7060105@cheapcomplexdevices.com (view raw or flat)
Thread:
Lists: 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?


In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-06-26 21:23:18
Subject: Re: Planner creating ineffective plans on LEFT OUTER joins
Previous:From: Josh BerkusDate: 2008-06-26 21:04:07
Subject: Re: TODO Item: Allow pg_hba.conf to specify host names along with IP addresses

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group