我感觉你可以少写一层管道,参考:
(root@nebula) [basketballplayer]> lookup on player YIELD vertex AS v | yield $-.v.player.age AS age, $-.v.player.name AS name WHERE $-.v.player.name CONTAINS "s"
+-----+-------------------------+
| age | name |
+-----+-------------------------+
| 22 | "Ben Simmons" |
| 29 | "Jonathon Simmons" |
| 33 | "LaMarcus Aldridge" |
| 25 | "Kyle Anderson" |
| 27 | "Cory Joseph" |
| 29 | "Klay Thompson" |
| 38 | "Paul Gasol" |
| 34 | "Marc Gasol" |
| 32 | "Aron Baynes" |
| 34 | "LeBron James" |
| 29 | "James Harden" |
| 36 | "Boris Diaw" |
| 23 | "Kristaps Porzingis" |
| 30 | "Russell Westbrook" |
| 38 | "David West" |
| 33 | "Chris Paul" |
| 45 | "Jason Kidd" |
| 24 | "Giannis Antetokounmpo" |
| 45 | "Steve Nash" |
+-----+-------------------------+
Got 19 rows (time spent 2.514ms/32.561875ms)
再就是如果 v 里数据很多,返回只是很小一部分,在第一步就精确剔除掉不需要的会更优化一些