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

Re: On query rewrite

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: sailesh(at)cs(dot)berkeley(dot)edu
Cc: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>,pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: On query rewrite
Date: 2004-05-28 16:29:54
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Sailesh Krishnamurthy <sailesh(at)cs(dot)berkeley(dot)edu> writes:
> Thanks again. To confirm the actual cost comparison with plan
> enumeration is a dynamic programming algorithm, is it not ?
> Selinger-style with 2-way join paths enumerated, then 3-way using the
> best 2-way etc. ? 

Correct.  For details see make_one_rel_by_joins in path/allpaths.c
and make_rels_by_joins in path/joinrels.c (dunno why what's basically
a single algorithm is split across two files).  There are some
heuristics involved concerning whether to consider clauseless joins,
so it's not totally trivial.

> BTW, do lots of people use the GEQO ? 

Only people writing queries that join more than a dozen or so tables.
GEQO is another thing we've improved (I think) recently, but it's still
pretty weak IMHO.  The algorithm is really designed to solve Traveling
Salesman problems, which bear only a crude resemblance to the behavior
of join problems.  I'd like to see a more principled solution in there

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-05-28 16:44:35
Subject: Re: list rewrite committed
Previous:From: Andreas PflugDate: 2004-05-28 16:29:48
Subject: Re: tablespaces and DB administration

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