JanusGraph / JanusGraph/janusgraph

Speed up label count performance

Open
#926 13 comments 10 reactions 0 assignees View on GitHub
kind/enhancement
Dominant language
Java
Stars
5.8k
Forks
1.2k
Avg merge
13h 53m
Merged PRs (30d)
6

Description

## Problem: Counting all vertices/edges by label is slow!

Users frequently need to count all nodes/edges of a type by label. This could be to verify data loading, to get acquainted with the data or as part of an equation. This is a frequent and essential operation, and yet the speed on graphs of any scale at all is incredibly slow, because all vertices/indexes must be traversed to do the counts.

## Solution: Keep label counts as global metadata

To solve this problem and greatly improve the user experience, I propose to do what many OLAP databases do: keep track of counts for entire tables/labels as you go. I am willing to do the implementation, I just need pointers as to how this might work.

## Questions

Along these lines, I have a few questions:

- What metadata is currently stored about a graph globally and how is it accessed?
- How might I update this global state for each query involving addEdge/addVertex and any other call impacting label counts.
- How much of this is Gremlin and how much of it is JanusGraph?

Thanks!

Contributor guide

Open the contributing guide

Research direction

The issue names no files, tests, or entry points. Begin by tracing how global graph metadata is stored and accessed and where addVertex/addEdge updates would occur; a complete implementation would need tests demonstrating correct label counts.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases, distributed-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.