Query optimisation - Apache TinkerPop