Re: Idea: Avoid JOINs by using path expressions to follow FKs

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Idea: Avoid JOINs by using path expressions to follow FKs
Date: 2021-03-27 21:11:06
Message-ID: 20210327211106.GA2507@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2021-Mar-27, Joel Jacobson wrote:

> If there would be multiple foreign keys on a column we try to follow,
> the query planner would throw an error forcing the user to use explicit joins instead.

This seems pretty dangerous -- you just have to create one more FK, and
suddenly a query that worked perfectly fine, now starts throwing errors
because it's now ambiguous. Feels a bit like JOIN NATURAL, which many
people discourage because of this problem.

--
Álvaro Herrera 39°49'30"S 73°17'W
Si no sabes adonde vas, es muy probable que acabes en otra parte.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Wong 2021-03-28 03:23:10 Re: [GSoC] Question about Add functionality to pg_top and supporting tools
Previous Message Pantelis Theodosiou 2021-03-27 21:01:06 Re: Idea: Avoid JOINs by using path expressions to follow FKs