chungquantin / solomon-db

An embedded Gremlin-compatible graph database written in Rust
https://nomadiz.github.io/solomon-db
MIT License
44 stars 1 forks source link

Gremlin: Enhance performance of reuse graph traversal source #7

Open chungquantin opened 1 year ago

chungquantin commented 1 year ago

Is your feature request related to a problem? Please describe.

let t1 = db
        .traverse()
        .v(1)
        .add_v("person")
        .property("github", "tin-snowflake")
        .property("name", "Tin Chung")
        .property("age", 21)
        .add_v("coder")
        .property("github", "chungquantin")
        .property("age", 30);

let t2 = t1.clone().has_key("github").has_label("person").exec().to_list().await.unwrap();
let t3 = t1.clone().has_key("github").exec().to_list().await.unwrap();
let t4 = t1.clone().has_not("name").exec().next().await.unwrap();

Describe the solution you'd like For now, query like this is exhaustive. Even though t1 is reused, all steps are handled again whenever t2, t3 or t4 called. Can implement a record checkpoint to enhance the situation