Re: Change JOIN tutorial to focus more on explicit joins

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Jürgen Purtz <juergen(at)purtz(dot)de>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, shammat(at)gmx(dot)net, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Change JOIN tutorial to focus more on explicit joins
Date: 2020-09-04 06:52:56
Message-ID: 9fd4b399-37c8-014e-e7ef-08fb0ecbbdcc@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers

On 2020-05-27 10:29, Jürgen Purtz wrote:
> The attached patch
>
> - prefers the explicit join-syntax over the implicit one and explains
> the keywords of the explicit syntax
>
> - uses a more accurate definition of 'join'
>
> - separates <programlisting> and <screen> tags
>
> - shifts <indexterm> definitions outside of <para> to get a better
> rendering in PDF
>
> - adds a note concerning IDs and foreign keys

I have committed some parts of this patch:

> - separates <programlisting> and <screen> tags

> - shifts <indexterm> definitions outside of <para> to get a better
> rendering in PDF

as well as the change of W1/W2 to w1/w2. (Note that there is also
src/tutorial/basics.source that should be adjusted in the same way.)

For the remaining patch I have a couple of concerns:

> <para>
> Attempt to determine the semantics of this query when the
> - <literal>WHERE</literal> clause is omitted.
> + <literal>ON</literal> clause is omitted.
> </para>
> </formalpara>

This no longer works.

In general, I agree that some more emphasis on the JOIN syntax is okay.
But I think the order in which the tutorial has taught it so far is
okay: First you do it the manual way, then you learn the more abstract way.

> + <note>
> + <para>
> + The examples shown here combine rows via city names.
> + This should help to understand the concept. Professional
> + solutions prefer to use numerical IDs and foreign keys
> + to join tables.
> + </para>
> + </note>

While there are interesting debates to be had about natural vs.
surrogate keys, I don't think we should imply that one of them is
unprofessional and then leave it at that and give no further guidance.
I think we should leave this out.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Jürgen Purtz 2020-09-04 09:36:39 Re: Change JOIN tutorial to focus more on explicit joins
Previous Message Bruce Momjian 2020-09-04 01:46:18 Re: Please provide examples of rows from

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2020-09-04 06:55:01 Re: [PATCH] Detect escape of ErrorContextCallback stack pointers (and from PG_TRY() )
Previous Message Pavel Stehule 2020-09-04 06:33:36 Re: Compatible defaults for LEAD/LAG