Re: About method of PostgreSQL's Optimizer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jonah(dot)harris(at)gmail(dot)com
Cc: pryscila(dot)lista(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: About method of PostgreSQL's Optimizer
Date: 2005-09-14 17:54:46
Message-ID: 6127.1126720486@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-performance

"Jonah H. Harris" <jonah(dot)harris(at)gmail(dot)com> writes:
> As for using both in the same optimizer, I could only see an algorithm such
> as a customized-A* being used to planning *some* large queries. The reason I
> say this is because the cost calculation, which would still need to be
> breadth-first, could calculate and cache the cost of most nodes thereby
> allowing you to possibly perform transformations at the tail of calculation.

We do already have two different plan search algorithms: the strict
bottom-up dynamic programming approach (System R style) and the GEQO
optimizer, which we switch to when there are too many joins needed to
allow exhaustive search. The GEQO code still depends on the normal
plan cost estimation code, but it doesn't consider every possible plan.

I've never been very happy with the GEQO code: the random component of
the algorithm means you get unpredictable (and sometimes awful) plans,
and the particular variant that we are using is really designed to solve
traveling-salesman problems. It's at best a poor fit to the join
planning problem.

So it seems interesting to me to think about replacing GEQO with a
rule-based optimizer for large join search spaces.

There are previous discussions about this in the archives, I believe.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-14 18:23:29 Re: Constraint Type Coercion issue?
Previous Message Josh Berkus 2005-09-14 17:48:34 Constraint Type Coercion issue?

Browse pgsql-performance by date

  From Date Subject
Next Message Peter Darley 2005-09-14 18:25:38 Battery Backed Cache for RAID
Previous Message Merlin Moncure 2005-09-14 17:10:32 Re: Low performance on Windows problem