kuzudb / kuzu

Embeddable property graph database management system built for query speed and scalability. Implements Cypher.
https://kuzudb.com/
MIT License
1.31k stars 94 forks source link

Feature: Rel tables with only forward directed storage #4320

Open ray6080 opened 1 day ago

ray6080 commented 1 day ago

Description

Currently, when we create rel tables, we always store rel tuples in a duplicated way that each tuple is stored in both forward and backward directed storage. This is to allow the flexibility of planner to pick plans that scan from either forward or backward directions. The downsides are: 1) storage space overheads; 2) copy/insert/update/delete overheads.

There are cases where only scan from forward or backward is needed, thus we don't need to keep the storage duplicated for both directions: 1) advanced users are aware that the rel tables can always be scanned in one direction; 2) full text search index always scan the rel tables from one direction.

Syntax changes

TBD

Planner and storage changes

TBD

semihsalihoglu-uw commented 1 day ago

Another use case of this is for storing undirected relationships if we start natively supporting undirected relationships. I think sooner or later we need to have this feature as the "directed only" nature of the edges of property graphs forces application-level tricks to force a direction on the edges.