groovy collection methods을 피하기 위해 더 나은 해석 않습니다. 그들은 Traversal
밖에 존재합니다. 당신이 explain()
작업을 수행 할 때
gremlin> g.V().hasLabel("person").order().by('name',incr).explain()
==>Traversal Explanation
===============================================================================================================================
Original Traversal [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
ConnectiveStrategy [D] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
RepeatUnrollStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
InlineFilterStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
MatchPredicateStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
PathRetractionStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
IncidentToAdjacentStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
AdjacentToIncidentStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
FilterRankingStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
RangeByIsCountStrategy [O] [GraphStep(vertex,[]), HasStep([~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
TinkerGraphStepStrategy [P] [TinkerGraphStep(vertex,[~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
ProfileStrategy [F] [TinkerGraphStep(vertex,[~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
StandardVerificationStrategy [V] [TinkerGraphStep(vertex,[~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
Final Traversal [TinkerGraphStep(vertex,[~label.eq(person)]), OrderGlobalStep([[value(name), incr]])]
, 당신은 Traversal
이 기본 그래프 데이터베이스에 어떻게 보이는지 볼 수 있습니다 : 당신처럼이 예를 생각해 보자. 이 경우 데이터베이스가 order()
에서 최적화 할 수 있다면이를 활용하여 더욱 효율적으로 사용할 수 있습니다. 단순히 g.V().hasLabel("person")
을 제출하고 그루비 수집 방법으로 전환했다면, 기본 데이터베이스는 "사람"정점 목록을 얻으 려하고 자신을 주문하려고했는지 알지 못합니다. 그루비의 사용 sort
).