chaisql / chai

Modern embedded SQL database
MIT License
1.56k stars 95 forks source link

Add Joins #3

Open asdine opened 5 years ago

tdakkota commented 4 years ago

Abstract

This proposal is mostly based on #297

Proposal: JOINs

For now, Genji have no ways to select several tables in one query. JOINs is the most commonly used way in relation databases.

Changes

gedw99 commented 3 years ago

@89z Great work

I would like to extend your example to add graphQL: https://github.com/UHN/ggql/tree/master/examples/reflection#define-the-api. This is a new graphql lib that is much faster than others.

With Genji backing it , it will be highly efficient.

Maybe we can make it a genji example too that people can use as a reference.

clarkmcc commented 3 years ago

Just out of curiosity, would interleaving tables as seen in Cloud Spanner be a suitable alternative to joins? While it's not a drop-in replacement for a traditional table join, it could provide additional performance in the form of data locality.

In the context of Cloud Spanner, interleaved tables also allow for better performance in a distributed context. I've seen several requests here for Raft or other HA implementations and while it sounds like that's a "maybe down the road" feature, interleaved tables could solve the future problem of joins between tables distributed across nodes by co-locating tables with each other on the same node.

gedw99 commented 3 years ago

Got links on this approach by any chance ?

On Sat 8. May 2021 at 21:49, Clark McCauley @.***> wrote:

Just out of curiosity, would interleaving tables https://cloud.google.com/spanner/docs/schema-and-data-model#parent-child_table_relationships as seen in Cloud Spanner be a suitable alternative to joins? While it's not a drop-in replacement for a traditional table join, it could provide additional performance in the form of data locality.

In the context of Cloud Spanner, interleaved tables also allow for better performance in a distributed context. I've seen several requests here for Raft or other HA implementations and while it sounds like that's a "maybe down the road" feature, interleaved tables could solve the future problem of joins between tables distributed across nodes by co-locating tables with each other on the same node.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/genjidb/genji/issues/3#issuecomment-835488249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMVPLFDHAXCVLGVGKV2UPITTMWIVJANCNFSM4HI6M3AQ .

-- Mobile: +4915231894553 Telegram: http://t.me/gedw99

clarkmcc commented 3 years ago

Besides the link I cited in my OP, the following links may be helpful.

Sadly, I haven't found much by way of implementation details.

tomasweigenast commented 1 year ago

Instead of joins, graph model can be implemented, its faster. Take a look at https://surrealdb.com/docs/surrealql/statements/relate @tdakkota @clarkmcc