Fastest way to check if a RID is from a Vertex or an Edge
36 views
Skip to first unread message
André Toscano
unread,
Sep 13, 2016, 9:06:35 AM9/13/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to orient-...@googlegroups.com
Hi guys, since now I was just watching the discussions.
I have I doubt that: What is the fastest way to ensure that a RID is from a vertex or an edge?
I was doing:
select from V where @rid = #<some_rid>
If I get the record it will be a vertex. This is a very expensive query, almost 2s in my system.
This is much faster:
select from #<some_rid> where @class = 'V' or @class in (SELECT name from (select expand(classes) from metadata:schema) where 'V' in superClasses)
This is executed in 40ms
But if I ask directly for the RID:
select from #<some_rid>
It takes 10 to 20ms
My ask is if there is a faster way (below of 40ms) to check the RID object type.
Best regards
André Emilio Toscano
Ivan Mainetti
unread,
Sep 13, 2016, 9:16:30 AM9/13/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to orient-...@googlegroups.com
Hi,
use this
selectfrom<rid>where@thisinstanceof'V'--> to verify whether it's a Vertex select from <rid> where @this instanceof 'E' --> to verify whether it's an Edge
André Toscano
unread,
Sep 13, 2016, 2:16:06 PM9/13/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message