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

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Idea: Avoid JOINs by using path expressions to follow FKs
Дата
Msg-id bfe7134b-f3c4-3195-7c01-55f78a9ae092@dunslane.net
обсуждение исходный текст
Ответ на Re: Idea: Avoid JOINs by using path expressions to follow FKs  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Ответы Re: Idea: Avoid JOINs by using path expressions to follow FKs  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 3/27/21 5:11 PM, Alvaro Herrera wrote:
> 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.
>


Maybe. I don't recall ever having seen a column with more than one FK.
Is that a common thing? In itself it seems like a bad idea.

Not saying I think this suggestion is a good idea, though. We've seen
many frameworks that hide joins, and the results are ... less than
universally good. If your application programmers don't like using
joins, then either a) you should have the DBA create some views for them
that contain the joins, or b) you have the wrong application programmers -:)


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: [PATCH] Hooks at XactCommand level
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: invalid data in file backup_label problem on windows