Skip to content

impl index spec - #2103

Merged
shivamka1 merged 44 commits into
masterfrom
features/index_spec
Jun 6, 2025
Merged

shivamka1 merged 44 commits into
masterfrom
features/index_spec

Conversation

@shivamka1

@shivamka1 shivamka1 commented May 22, 2025 •

Copy link
Copy Markdown
Contributor

This PR implements IndexSpec that can be used to create index for properties selectively: #1985

 let graph = init_graph(Graph::new());

let index_spec = IndexSpecBuilder::new(graph.clone())
    .with_const_node_props(vec!["x"])?
    .with_all_temp_node_props()
    .with_all_edge_props()
    .build();

graph.create_index_in_ram_with_spec(index_spec).unwrap();

On python this looks like:

graph = init_graph(Graph())
spec = (
    IndexSpecBuilder(graph)
    .with_const_node_props(["y"])
    .with_temp_node_props(["p1"])
    .with_const_edge_props(["e_y"])
    .with_temp_edge_props(["e_p1"])
    .build()
)

graph.create_index_in_ram_with_spec(spec)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Rust Benchmark'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: 425556f Previous: b1a22cf Ratio
lotr_graph_window_100/iterate nodes 7238 ns/iter (± 449) 3110 ns/iter (± 46) 2.33

This comment was automatically generated by workflow using github-action-benchmark.

@ljeub-pometry ljeub-pometry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix race condition in index creation

Comment thread python/test_utils/filters_setup.py Outdated
Comment thread python/tests/test_base_install/test_index_spec.py
Comment thread raphtory/src/core/utils/errors.rs Outdated
Comment thread raphtory/src/db/api/storage/storage.rs Outdated
Comment thread raphtory/src/db/api/storage/storage.rs
Comment thread raphtory/src/search/entity_index.rs Outdated
Comment thread raphtory/src/search/graph_index.rs Outdated
Comment thread raphtory/src/search/node_index.rs
Comment thread raphtory/src/search/node_index.rs Outdated
Comment thread raphtory/src/search/node_index.rs

@ljeub-pometry ljeub-pometry left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor things to tidy up but looking good otherwise

Comment thread python/test_utils/utils.py
Comment thread python/tests/test_base_install/test_graphql/test_edge_sorting.py Outdated
Comment thread raphtory/src/db/graph/views/filter/mod.rs
Comment thread raphtory/src/python/graph/index.rs
Comment thread raphtory/src/search/entity_index.rs Outdated
Comment thread raphtory/src/search/mod.rs Outdated
Comment thread raphtory/src/search/node_index.rs Outdated
@shivamka1
shivamka1 marked this pull request as ready for review June 5, 2025 15:12
@shivamka1
shivamka1 merged commit 48a104d into master Jun 6, 2025
@shivamka1
shivamka1 deleted the features/index_spec branch June 6, 2025 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants