Re: Idea: Avoid JOINs by using path expressions to follow FKs
| От | Joel Jacobson |
|---|---|
| Тема | Re: Idea: Avoid JOINs by using path expressions to follow FKs |
| Дата | |
| Msg-id | 2cd5681d-3b5d-420d-8b6e-b88802038921@www.fastmail.com обсуждение исходный текст |
| Ответ на | Re: Idea: Avoid JOINs by using path expressions to follow FKs (Tom Lane <tgl@sss.pgh.pa.us>) |
| Список | pgsql-hackers |
On Sun, Mar 28, 2021, at 16:04, Tom Lane wrote:
Andrew Dunstan <andrew@dunslane.net> writes:> 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.Yeah, that aspect seems like a complete show-stopper. We have a wayto enforce that you can't *drop* a constraint that some stored viewdepends on for semantic validity. We don't have a way to say thatyou can't *add* a constraint-with-certain-properties. And I don'tthink it'd be very practical to do (consider race conditions, ifnothing more).
Thanks for valuable insights, I didn't think about these things.
What if the path expressions are just syntactic sugar for an INNER JOIN on the referencing -> referenced column?
If a VIEW is created using this syntax, it would be stored as INNER JOINs, similar to how SELECT * is expanded.
/Joel
В списке pgsql-hackers по дате отправления: