1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Property index support for efficient lookups.
//!
//! This module provides property indexes that transform O(n) property scans into
//! O(log n) or O(1) lookups, dramatically improving query performance on large graphs.
//!
//! # Index Types
//!
//! | Type | Use Case | Lookup Complexity |
//! |------|----------|-------------------|
//! | [`BTreeIndex`] | Range queries, ordered iteration | O(log n) + O(k) |
//! | [`UniqueIndex`] | Exact match with uniqueness constraint | O(1) average |
//!
//! # Example
//!
//! ```rust,ignore
//! use interstellar::index::IndexBuilder;
//! use interstellar::storage::Graph;
//!
//! let graph = Graph::new();
//!
//! // Create a B+ tree index for range queries
//! graph.create_index(
//! IndexBuilder::vertex()
//! .label("person")
//! .property("age")
//! .build()
//! .unwrap()
//! ).unwrap();
//!
//! // Create a unique index for O(1) lookups with uniqueness constraint
//! graph.create_index(
//! IndexBuilder::vertex()
//! .label("user")
//! .property("email")
//! .unique()
//! .build()
//! .unwrap()
//! ).unwrap();
//!
//! // Queries automatically use indexes when applicable
//! let adults = graph.gremlin().v()
//! .has_label("person")
//! .has_where("age", p::gte(18))
//! .to_list();
//! ```
//!
//! # How It Works
//!
//! 1. **Index Creation**: When you create an index, existing data is scanned and
//! indexed. The index is then maintained automatically on insert/update/delete.
//!
//! 2. **Automatic Selection**: Filter steps like `has_value()` and `has_where()`
//! check for applicable indexes and use them when beneficial.
//!
//! 3. **Transparent Integration**: Both the Gremlin-style traversal API and GQL
//! queries benefit from indexes without any API changes.
pub use BTreeIndex;
pub use IndexError;
pub use RTreeIndex;
pub use ;
pub use ;
pub use UniqueIndex;