About using @rid in the MATCH syntax

Hi all,

How can I use @rid in the MATCH syntax? I have tried the following script, but found that it does not fetch records from RIDs directly according to the explain plan:

image image

the equivalent version of
match{class: patient, where: (@rid = "#39:0")} return $paths
without the match statement is:
select from patient where @rid = "#39:0"
if you compare the explains of these two their are approximately the same.

With Match:

Without Match:

Hope it helps.


I know this, but with SELECT syntax, I can use “select from @rid” to directly fetch records from rid, and I want to know if there is any equivalent version, because in some situation I need to traverse from some vertexes using MATCH syntax, and fetching the vertexes directly from rid is more effiently.

I’ve got the same question and came to an obvious solution

The difference
“Select from »some rid«” returns the database-class.

Using "match{ class: »some class«, where (@rid = »some rid«} " you have to specify the class.

As the query always starts with a vertex, one can substitute this with

 match{ class: V, where (@rid = »some rid«}

Question remains: why is it not possible just to specify

 match{ #39:0  } -> { ....