From: Erik Wienhold <ewie@ewie.name>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-docs@lists.postgresql.org
Subject: Re: Cross-Product JOIN?
Date: Thu, 25 May 2023 08:59:55 +0200 (CEST)
Message-ID: <1217818053.151381.1684997995236@office.mailbox.org> (raw)
In-Reply-To: <680324ce9104e3d8e9d93b040c152b8bd47b361e.camel@cybertec.at>
References: <CAL3CXNMes1r4s78QnMAekj9W1nchGH7dbq86wyEFB2gxqQrJ-g@mail.gmail.com>
<1667253069.131800.1684935988763@office.mailbox.org>
<2053109544.160895.1684955437950@office.mailbox.org>
<680324ce9104e3d8e9d93b040c152b8bd47b361e.camel@cybertec.at>
> On 25/05/2023 06:52 CEST Laurenz Albe <laurenz.albe@cybertec.at> wrote:
>
> On Wed, 2023-05-24 at 21:10 +0200, Erik Wienhold wrote:
> > > On 24/05/2023 15:46 CEST Erik Wienhold <ewie@ewie.name> wrote:
> > >
> > > Personally, I think it should read cartesian product because cross product is
> > > an overloaded term and cartesian product is used more often in the documentation
> > > overall.
> > >
> > > But the same page [0] also uses cross product when talking about grouping sets.
> > >
> > > [0] https://www.postgresql.org/docs/15/queries-table-expressions.html
> >
> > Here's a patch that fixes those two places.
>
> +1
>
> "Cross product" seems to be a misbegotten hybrid of "cross join" and
> "Cartesian product".
Cross product can mean Cartesian product depending on the context. [0]
> Since we are talking about Cartesian products: is the term "Cartesian join"
> used anywhere?
Not in the docs:
$ git grep -iw cartesian -- doc
doc/src/sgml/cube.sgml: the lower-dimensional one is assumed to be a Cartesian projection, i. e., having zeroes
doc/src/sgml/perform.sgml: would be inefficient, since the full Cartesian product of A and C
doc/src/sgml/planstats.sgml: Cartesian product of the two inputs, multiplied by the
doc/src/sgml/queries.sgml: (that is, the Cartesian product of their rows is formed; see below).
doc/src/sgml/queries.sgml: <replaceable>T2</replaceable> (i.e., a Cartesian product),
doc/src/sgml/ref/select.sgml: specified, the result is the Cartesian product (cross join) of all
doc/src/sgml/ref/select.sgml: Cartesian product.
doc/src/sgml/ref/select.sgml: Cartesian product (i.e., all combined rows that pass its join
doc/src/sgml/ref/select.sgml: They produce a simple Cartesian product, the same result as you get from
but in a few comments:
$ git grep -i 'cartesian\(\s\+join\|\s*$\)'
src/backend/optimizer/geqo/geqo_eval.c: * a cartesian join to be performed. When force is false, do only
src/backend/optimizer/path/joinrels.c: * upper level, we must be willing to make a cartesian join of a and b;
src/backend/optimizer/path/joinrels.c: * cartesian joins in this case (no bushy).
src/test/regress/expected/join.out:-- test for ability to use a cartesian join when necessary
src/test/regress/sql/join.sql:-- test for ability to use a cartesian join when necessary
[0] https://mathworld.wolfram.com/CartesianProduct.html
--
Erik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: ewie@ewie.name, laurenz.albe@cybertec.at, pgsql-docs@lists.postgresql.org
Subject: Re: Cross-Product JOIN?
In-Reply-To: <1217818053.151381.1684997995236@office.mailbox.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox