Re: Re: [COMMITTERS] pgsql: Rewrite GEQO's gimme_tree function so that it always finds a

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: [COMMITTERS] pgsql: Rewrite GEQO's gimme_tree function so that it always finds a
Date: 2009-12-04 03:51:24
Message-ID: 603c8f070912031951w66c45272l3de6d5d04f84278e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, Dec 2, 2009 at 10:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> Well, when I was testing, I believe I observed that an n-way join with
>> 1 cross join was slower to plan than an n-way join with no cross
>> joins.  ISTM that it should actually be faster, because you should
>> plan it like an (n-1)-way join and then do the cross join at the end.
>
> It's not entirely clear to me what case you're describing, but I wonder
> whether this was a "flat" join problem or restricted by the collapse
> limits.

Argh. I can't reproduce exactly what I thought I was seeing before.
However, with the attached schema, geqo off, and the collapse
thresholds set to 100, "explain select * from bar2_view" and "explain
select * from bar3_view" have roughly the same run time. They are
identical except that one of the join clauses has been omitted in the
second case. One would think that the second case could be planned
faster, if we plan to just leave the cross join to the end.

(And in fact on my system if you remove bar8 from the second view
entirely the plan time improves by a factor of six.)

...Robert

Attachment Content-Type Size
join2.sql application/octet-stream 4.7 KB

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message User Mkz 2009-12-04 10:28:46 pgbouncer - pgbouncer: Apply client_login_timeout to clients waiting for
Previous Message User Itagaki 2009-12-04 00:31:07 orafce - orafce: Add documentation for utl_file.fopen() with an

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2009-12-04 04:38:06 Re: operator exclusion constraints
Previous Message KaiGai Kohei 2009-12-04 03:42:26 Re: [PATCH] Largeobject Access Controls (r2432)