如何查询多个指定点类型的目标点

目前是这样实现的。但是会扫描所有目标点,数据量大的是时候会很慢,有没有好的解决办法
match p=(t:USR)-[e]->(t2) where id(t) == ‘207d1be42c62423492dc56cea31e07a3’
with p,[‘ROL’,‘ORG’] as tagNames,tags(t2) as relTags where any(n in tagNames where n in relTags) return p

(root@nebula) [basketballplayer]> match (t:player)-[e]-(:player) where id(t)=="player100" return e union match (t:player)-[e]-(:team) where id(t) =="player100" return e
+-------------------------------------------------------------------------------------+
| e                                                                                   |
+-------------------------------------------------------------------------------------+
| [:follow "player100"->"player101" @0 {degree: 95, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player100"->"player125" @0 {degree: 95, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player101"->"player100" @0 {degree: 95, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player102"->"player100" @0 {degree: 75, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player104"->"player100" @0 {degree: 55, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player105"->"player100" @0 {degree: 70, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player107"->"player100" @0 {degree: 80, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player108"->"player100" @0 {degree: 80, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player109"->"player100" @0 {degree: 80, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player113"->"player100" @0 {degree: 99, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player125"->"player100" @0 {degree: 90, p3: __NULL__, p4: __NULL__}]      |
| [:follow "player144"->"player100" @0 {degree: 80, p3: __NULL__, p4: __NULL__}]      |
| [:serve "player100"->"team204" @0 {end_year: 2016, p3: __NULL__, start_year: 1997}] |
+-------------------------------------------------------------------------------------+
Got 13 rows (time spent 16.318ms/17.652945ms)
  1. 能不用 p 就不用 p
  2. where 条件是查询以后过滤,性能应该比较差些;所以直接在 match 里用 tag 做下推
  3. 不过这种不适合做 limit 的写法,limit 只针对最后一个 match 有效

就是因为不支持limit才这么做的

你的边呢?可以考虑通过边类型来过滤。