Raphtory icon indicating copy to clipboard operation
Raphtory copied to clipboard

Update earliest_time_global() and latest_time_global() to return TimeIndexEntry instead of i64.

Open arienandalibi opened this issue 3 months ago • 0 comments

We should update GraphTimeSemanticsOps::earliest_time_global(), latest_time_global(), earliest_time_window(), and latest_time_window() to return Option<TimeIndexEntry> instead of Option<i64>. The trait is currently defined in "raphtory/src/db/api/view/internal/time_semantics/mod.rs"

Changing it would require for TemporalGraph in "raphtory-core/src/entities/graph/tgraph.rs" to be updated such that it's earliest_time and latest_time fields track secondary indices as well as timestamps. Those fields are currently MinCounter and MaxCounter respectively, which use AtomicI64 types for multi-threaded support, allowing concurrent updates to timestamps while maintaining consistency.

Updating MinCounter and MaxCounter to also track secondary indices without impacting performance is not trivial. The timestamp and secondary index need to stay consistent with one another as they are a pair. Ensuring that this consistency is maintained will likely require a lock, which comes at a performance cost.

arienandalibi avatar Sep 30 '25 06:09 arienandalibi