Re: a path towards replacing GEQO with something better - Mailing list pgsql-hackers

From John Naylor
Subject Re: a path towards replacing GEQO with something better
Date
Msg-id CAFBsxsHPMvSCut4_Th9Nktg4PZ77SpFptm5NUngHtCWj_ZAe1g@mail.gmail.com
Whole thread Raw
In response to Re: a path towards replacing GEQO with something better  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Wed, Jun 16, 2021 at 12:01 PM Robert Haas <robertmhaas@gmail.com> wrote:
>
> I feel like these are completely equivalent. Either way, the planner
> is going to deduce that all the ".col" columns are equal to each other
> via the equivalence class machinery, and then the subsequent planning
> will be absolutely identical. Or am I missing something?

Ok, I've modified the examples so it reflects the distinction:

A chain has join predicates linking relations in a linear sequence:

SELECT  *
FROM    tab1, tab2, tab3, tab4
WHERE   tab1.a = tab2.b AND
       tab2.i = tab3.j AND
        tab3.x = tab4.y

A star has a hub with join predicates to multiple spokes:

SELECT  *
FROM    tab1, tab2, tab3, tab4
WHERE   tab1.f1 = tab2.d1 AND
        tab1.f2 = tab3.d2 AND
        tab1.f3 = tab4.d3

--
John Naylor
EDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [Proposal] Fully WAL logged CREATE DATABASE - No Checkpoints
Next
From: Zhihong Yu
Date:
Subject: Re: A qsort template