Re: Idea: Avoid JOINs by using path expressions to follow FKs - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: Idea: Avoid JOINs by using path expressions to follow FKs
Date
Msg-id e9b2d98b-a12a-42f8-8fa7-b1fae54942f3@www.fastmail.com
Whole thread Raw
In response to Re: Idea: Avoid JOINs by using path expressions to follow FKs  (Vik Fearing <vik@postgresfriends.org>)
List pgsql-hackers
In a Hacker News discussion [2] on using foreign keys for joins,
the author of PostgREST, Steve Chavez, mentioned they are actually already
using this idea in PostgREST:

Steve Chavez wrote:
>The idea about using FK as a JOIN target is interesting.
>While developing a syntax for PostgREST resource embedding[1],
>I also reached the conclusion that FKs would be a convenient way to join tables
>(also suggested renaming them as you do here).
>
>IIRC, self joins are still an issue with FK joining.
>

I think this idea looks very promising and fruitful.

Maybe we can think of some other existing/new operator which would be acceptable,
instead of using "->" (which is potentially in conflict with the SQL standard's "REF" thing)?

Not saying we should move forward on our own with this idea,
but if we can come up with a complete proposal,
maybe it can be presented as an idea to the SQL committee?


/Joel

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: A reloption for partitioned tables - parallel_workers
Next
From: Etsuro Fujita
Date:
Subject: Re: Asynchronous Append on postgres_fdw nodes.