Re: a path towards replacing GEQO with something better

From: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: a path towards replacing GEQO with something better
Date: 2021-06-16 16:24:05
Message-ID: CAFBsxsFZgRxJEbJsbRFVDis6bQFL8GSEHjZdC+eLkKS8r5116A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jun 16, 2021 at 12:01 PM Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Tue, Jun 15, 2021 at 2:16 PM John Naylor
> <john(dot)naylor(at)enterprisedb(dot)com> wrote:
> > > I don't quite understand the difference between the "chain" case and
> > > the "star" case. Can you show sample queries for each one? e.g. SELECT
> > > ... FROM a_1, a_2, ..., a_n WHERE <something>?
> >
> > SELECT *
> > FROM tab1, tab2, tab3, tab4
> > WHERE tab1.col = tab2.col AND
> > tab2.col = tab3.col AND
> > tab3.col = tab4.col
> >
> > SELECT *
> > FROM tab1, tab2, tab3, tab4
> > WHERE tab1.col = tab2.col AND
> > tab1.col = tab3.col AND
> > tab1.col = tab4.col
>
> 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?

I believe the intention of the example is that ".col" is a place holder for
some column (all different). Otherwise, with enough ECs it would result in
an even bigger set of joinrels than what we see here. If ECs don't actually
cause additional joinrels to be created, then I'm missing something
fundamental.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2021-06-16 16:45:59 Allowing regular identifiers in isolationtester scripts
Previous Message Yugo NAGATA 2021-06-16 16:23:49 Re: Avoid stuck of pbgench due to skipped transactions