Lightweight Edges not maintained when using SQL DELETE VERTEX

19 views
Skip to first unread message

Eric24

unread,
Nov 13, 2017, 1:21:40 PM11/13/17
to OrientDB
It has been mentioned many times that using lightweight edges is "more difficult" with SQL. Can anyone provide specific examples of when this is true (i.e. what are the SQL issues created by using them)?

I ask because just about everything I've tried with lightweight edges works the same way with regular edges (even SELECTs that return linked records using both kinds of edges in a single query).

The one thing I've found that doesn't work with lightweight edges (which is a bit of a surprise to me) is that the links are not "cleaned up" when doing a DELETE VERTEX operation (i.e. "broken" links are left in the remaining vertex records). Is this an expected behavior? If so, it should probably be listed in the documentation as one of the cons to lightweight edges. If not, what is the appropriate way to delete a vertex record while ensuring that links to the deleted record are removed from the remaining records?

Luigi Dell'Aquila

unread,
Nov 14, 2017, 3:18:36 AM11/14/17
to orient-...@googlegroups.com
Hi Eric,

The main problem with lightweight edges is that they do not have an identity, so they don't "physically" exist.
The big disadvantages are that:
- you cannot point to a single lightweight edge by RID
- you cannot count them, eg. SELECT FROM E will return a wrong result

The DELETE VERTEX is supposed to work fine though, if you have a test case that proves the problem please submit it, I'll check it asap

Thanks

Luigi


--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric24

unread,
Nov 14, 2017, 2:30:25 PM11/14/17
to OrientDB
Steps to produce bug:
  1. Enable Lightweight Edges
  2. CREATE CLASS SimpleV EXTENDS V
  3. CREATE CLASS SimpleE EXTENDS E
  4. INSERT INTO SimpleV CONTENT {"name":"A"}  // this is #25:0
  5. INSERT INTO SimpleV CONTENT {"name":"B"}  // this is #25:1
  6. CREATE EDGE SimpleE FROM #25:0 TO #25:1
  7. SELECT FROM SimpleE  // empty result, provides that Lightweight Edge was used
  8. DELETE VERTEX #25:1
  9. SELECT FROM SimpleV  // returns #25:0, with OUT still showing link to #25:1
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

Luigi Dell'Aquila

unread,
Nov 15, 2017, 4:08:38 AM11/15/17
to orient-...@googlegroups.com
Thank you very much, in case you want to track the resolution of this problem, you can watch this: https://github.com/orientechnologies/orientdb/issues/new

Thanks

Luigi

To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages