Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

A vertex looked up by id costs up to three backend reads: its existence, its properties and its label

Aperta
#5,016 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@porunov ci sta già lavorando.

Dal 5/10/2026.

  • #5018 di @porunov — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
cassandra, java

Direzione di ricerca

Start with StandardJanusGraphTx.VertexConstructor to trace the existence check and the relation slices read for a vertex lookup. Then read CacheVertex.getSuperResultSet and SliceQuery.subsumes to understand how a broader cached result could serve later label and property queries. Check backend read counts for single- and multi-id lookups; done means the proposed bounded slice avoids redundant reads without loading unbounded property data for existence-only checks.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/performance

Looking a vertex up by its id (g.V(id), graph.vertices(ids), tx.getVertex(id)) reads its row from the storage backend up to three times, each a round trip on a remote backend such as Cassandra:

  1. StandardJanusGraphTx.VertexConstructor reads the slice of the VertexExists system property to tell whether the vertex exists (every transaction verifies the existence of vertices looked up by id unless checkExternalVertexExistence(false) is set, as storage.batch-loading does).
  2. The first access to one of its properties reads all of its properties (query.fast-property, on by default): a second slice of the same row.
  3. The first access to its label reads the vertexlabel system edge: a third slice.

So g.V(id).values('name') costs two round trips, and anything which reads the label too, such as serializing the vertex for a client, g.V(id).elementMap() or g.V(id).valueMap(true), three. g.V(id1, id2, …) reads the existence of all the ids in one multi-key read, then the properties and the labels of each vertex (one more multi-key read each with query.batch, one read per vertex without).

The three slices are adjacent in the row. The column prefix of a relation (IDHandler.DirectionID.getPrefix) sorts system properties first, then system edges, then user properties, then user edges, so one slice from the first system relation to the end of the user properties holds the existence marker, which is the first cell of every vertex (system property, type id 1), the label edge and every property, and nothing else; the system relations alone hold the marker and the label.

A traversal knows what it reads of a looked-up vertex next, so its lookup could read that along with the existence, in one of these slices bounded by a limit, and keep a complete result in the vertex's relation cache, whose superset lookup (CacheVertex.getSuperResultSet, SliceQuery.subsumes) then answers the step's query without a backend read: the label for label() or hasLabel(...), the label and all properties for valueMap(), elementMap() or a has(...) with query.fast-property. It must read nothing the traversal wouldn't read: g.V(id).out() reads no property, and a step which reads one property by key must not have all of them read, which would be expensive for wide vertices. Several ids looked up together can be read with one multi-key read where the next step reads all of them in one batch.

Lingua principale
Java
Stelle
5.9k
Fork
1.2k
Merge medio
2g 6h
PR unite (30g)
77

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JanusGraph/janusgraph

Tutte le issue di JanusGraph/janusgraph

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.