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

From: "Joel Jacobson" <joel(at)compiler(dot)org>
To: "Vik Fearing" <vik(at)postgresfriends(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Andrew Dunstan" <andrew(at)dunslane(dot)net>
Cc: "Alvaro Herrera" <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Idea: Avoid JOINs by using path expressions to follow FKs
Date: 2021-03-29 20:59:38
Message-ID: 81d15974-4be3-4524-b576-ce58ee9def88@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Mar 29, 2021, at 20:53, Vik Fearing wrote:
> On 3/29/21 7:55 PM, Joel Jacobson wrote:
> > Do you know if REF is meant to be a replacement for foreign keys?
> >
> > Are they a different thing meant to co-exist with foreign keys,
> > or are they actually foreign keys "under the hood"
> > or something else entirely?
>
> They're supposed to be OOP where each row in the typed table is an
> instance of the object. Types can also have methods associated with
> them, and the instance tables can have subtables similar to our table
> inheritance. The dereference operator is replaced by a subquery.
>
> There is a whole slew of things in this area of the standard that
> apparently never caught on.

Hmm. Since it never caught on, maybe it was partly due to too much complexity, and maybe can invent a simpler solution?

I would also be against this idea if the complexity cost would be too high,
but I think Tom's foreign key constraint name idea looks fruitful since it's simple and non-invasive.

/Joel

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-03-29 21:00:13 Re: Add client connection check during the execution of the query
Previous Message Christoph Berg 2021-03-29 20:44:29 "box" type description