Re: [HACKERS] Fwd: Joins and links - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Fwd: Joins and links
Date
Msg-id 21561.931196249@sss.pgh.pa.us
Whole thread Raw
In response to Fwd: Joins and links  (Leon <leon@udmnet.ru>)
Responses Re: [HACKERS] Fwd: Joins and links
List pgsql-hackers
Leon <leon@udmnet.ru> writes:
>  We should make a real reference in one table to another! That
>  means there could be special data type called, say, "link",
>  which is a physical record number in the foreign table.

There is no such thing as a physical record number for a tuple in
Postgres.  The closest you could come is an OID, which isn't really any
faster than any other joinable field --- you still need an index to
support fast lookup by OID.

If we did have such a concept, the speed penalties for supporting
hard links from one tuple to another would be enormous.  Every time
you change a tuple, you'd have to try to figure out what other tuples
reference it, and update them all.

Finally, I'm not convinced that the results would be materially faster
than a standard mergejoin (assuming that you have indexes on both the
fields being joined) or hashjoin (in the case that one table is small
enough to be loaded into memory).
        regards, tom lane


pgsql-hackers by date:

Previous
From: Leon
Date:
Subject: Fwd: Joins and links
Next
From: Leon
Date:
Subject: Re[2]: [HACKERS] Fwd: Joins and links